FreeTextAnnotation label disappearing after search

Product: Document Web-viewer (Pdf viewer)

Product Version: 10.10.1 and 11.8.0

Please give a brief summary of your issue:
I’m encountering an issue where the text in a FreeTextAnnotation is disappearing after performing a search. I attached a video demonstrating the problem.

Some things I noticed:

  • The search highlights appear, then shortly after the labels disappear
  • The labels do not come back until page refresh
  • The opacity of some of the annotations changes when the labels disappear (see the green/red annotations at the bottom)
  • Zooming in/out results in a flicker where all disappear, fully reappear, then the labels disappear
  • The labels reappear at a certain zoom level

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems like you’re experiencing an issue with FreeTextAnnotations disappearing after a search operation in the WebViewer. This could be due to how the rendering is handled during and after the search process, possibly involving the layers or visibility of annotations.

Some things you can try:

  • Ensure that your WebViewer is correctly handling Optional Content Groups (OCGs) or layers, as these might affect annotation visibility.

  • Check if there are any event listeners or custom scripts that modify annotation visibility during search operations.

  • Try adjusting the rendering settings or options related to annotations in your WebViewer configuration.

  • Look into the opacity and visibility properties of annotations, especially during zoom or search events.




Here are some resources that might help you:



Hopefully, this helps you solve your problem while you wait for a human to get back to you.

Hi Pdobson,

Thank you for reaching out.

  1. Could you provide the sample file you were using in the video so we can try to reproduce on our side?
  2. Were you able to reproduce on another file or is it specific to this one?

Thank you.

Best Regards,
Mickaël.

Hi Mickael,

  1. Yep, its a png that we’ve run through the pdftron ocr module

  2. It is happening with other files as well

I’ve been doing some debugging and it seems to be caused by the globalCompositeOperation of the canvas switching from source-over to destination-over. I overrode the canvas methods to always switch it back to source-over and it seems to resolve the problem. The search highlights are no longer see through after I do this, but I can fix that by adjusting the alpha channel on the colors passed into setSearchHighlightColors.

With destination-over

With source-over

Hi Pdobson,

Thank you for your feedback.

Could you please provide the results of your OCR processing so we can reproduce this on our end?

Best Regards,
Mickaël.

ABC_Co_invoice.pdf (182.0 KB)

Yep, here’s the converted pdf

Hi Pdobson,

Thank you for your reply and for providing the file.

I don’t see the same label on the file as you were showing in your screen record.

Could you share the steps you took to add them to the file? (Or code snippet if you have one)

Best Regards,
Mickaël.

Hi Mickael, we’re storing the annotations separately and calling importAnnotations on them when we load the pdf viewer. Here’s are the xfdf for each of the annotations from my latest tests

<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots><square page="0" rect="224.63,725.54,277.25,751.86" color="#59D478" flags="print" name="9357a59a-c8dd-1e40-f241-c80e340688ab" subject="Rectangle" date="D:20251021155620-04'00'" width="3" creationdate="D:20251021155617-04'00'" dashes=""><trn-custom-data bytes="{&quot;trn-annot-no-delete&quot;:&quot;true&quot;}"/></square></annots></xfdf>
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots><freetext page="0" rect="0,818.5,40,838.5" color="#59D478" flags="print,lockedcontents" name="9a5ff585-4cc4-b641-8a9d-eabe2ced7cdb" subject="FreeText" date="D:20251021155620-04'00'" creationdate="D:20251021155620-04'00'" TextColor="#FFFFFF" FontSize="12"><trn-custom-data bytes="{&quot;trn-annot-no-delete&quot;:&quot;true&quot;,&quot;trn-wrapped-text-lines&quot;:&quot;[\&quot;A \&quot;]&quot;}"/><contents>A</contents><defaultappearance>0.349 0.831 0.471 rg /Helvetica 12 Tf</defaultappearance><defaultstyle>font: Helvetica 12pt; text-align: center; text-vertical-align: bottom; color: #FFFFFF</defaultstyle></freetext></annots></xfdf>
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots><square page="0" rect="274.94,564.86,345.3,586.36" color="#FF8F8F" flags="print" name="08db23bf-f333-bc94-ede7-145d64682131" subject="Rectangle" date="D:20251021155633-04'00'" width="3" creationdate="D:20251021155629-04'00'" dashes=""><trn-custom-data bytes="{&quot;trn-annot-no-delete&quot;:&quot;true&quot;}"/></square></annots></xfdf>
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots><freetext page="0" rect="0,818.5,40,838.5" color="#FF8F8F" flags="print,lockedcontents" name="f620b928-aa8b-1918-5ce6-fd264df19f20" subject="FreeText" date="D:20251021155633-04'00'" creationdate="D:20251021155633-04'00'" TextColor="#FFFFFF" FontSize="12"><trn-custom-data bytes="{&quot;trn-annot-no-delete&quot;:&quot;true&quot;,&quot;trn-wrapped-text-lines&quot;:&quot;[\&quot;A \&quot;]&quot;}"/><contents>A</contents><defaultappearance>1 0.561 0.561 rg /Helvetica 12 Tf</defaultappearance><defaultstyle>font: Helvetica 12pt; text-align: center; text-vertical-align: bottom; color: #FFFFFF</defaultstyle></freetext></annots></xfdf>

Hi Pdobson,

I was able to reproduce your issue using your sample file and XFDF.

Thank you for providing them.

I have added this issue to the backlog for the product team to review. I included your research about the globalCompositeOperation and source-over versus destination-over as well.

We will let you know when we have additional updates.

Best Regards,
Mickaël.

1 Like

I have added this issue to the backlog for the product team to review.

Hi Mickael, thank you so much for looking at this. This is a highly impactful bug for our users at AuditBoard. Could we escalate the priority on this bug fix?

Ben

1 Like

Hi Ben,

Thank you for reaching out.

I’ve raised the urgency of your situation in the backlog.
We will let you know when we have an update.

Best Regards,
Mickaël.

2 Likes