Text of annotation is invisible when edited

WebViewer Version: 10.5.1

Do you have an issue with a specific file(s)?
No

Can you reproduce using one of our samples or online demos?
Yes

Are you using the WebViewer server?
No

Does the issue only happen on certain browsers?
No

Is your issue related to a front-end framework?#
No

Is your issue related to annotations?
Yes

Please give a brief summary of your issue:
When a callout rectangle is modified via code, the text in it get’s invisible.

Please describe your issue and provide steps to reproduce it:
We have PDFs with callout rectangles. When we open the PDF everything looks fine, as it should be:

As soon as we touch the annotation (for example setting ReadOnly or Locked to true) the Text of the callout is invisible:

Please provide a link to a minimal sample where the issue is reproducible:
Here’s a small example based on the webviewer angular example:

Steps to reproduce:

  • Download and extract Zip-File.
  • Run npm install
  • Rung ng serve
  • Click on the Button “Test” on the top left corner
  • The PDF that is being downloaded has the callout rectangle with the text, but the text is invisible
1 Like

Hello Chris,

Thank you for contacting Support.

I was able to reproduce the issue with your project, but I also tried creating a callout in the viewer and I couldn’t get the text to disappear. Could you explain how you created those callout annotations as well?

I also noticed you are setting ReadOnly to true for all the annotations.

    annots.forEach(annot => {
      annot.ReadOnly = true;
    })

When I double click the annotations, I see a PDFWorker error and the subject isn’t callout when I call the API below.

Please explain how you created that callout.

Thank you.

Best Regards,
Darian

1 Like

Could you explain how you created those callout annotations as well?

Unfortunately not as this is a pdf we got from one of our customers.

I also noticed you are setting ReadOnly to true for all the annotations.

Yes. It doesn’t make that much sense in that example. But this was intended, as it is a part of the code we are using.

When I double click the annotations, I see a PDFWorker error and the subject isn’t callout when I call the API below.

I tested this. This happens with all comments (regardless if it is created via the webviewer or via a external program), after this line of code const arr = new Uint8Array(data);

  async getPDFAsBlob(): Promise<Blob> {
    const docViewer = this.wvInstance!.Core.documentViewer;
    const annotManager = docViewer.getAnnotationManager();

    const annots = annotManager.getAnnotationsList();
    annots.forEach(annot => {
      annot.ReadOnly = true;
    })

    const doc = docViewer.getDocument();

    const annotations = await annotManager.exportAnnotations();
    const data = await doc.getFileData({ xfdfString: annotations });
    // This Line causes the error when selecting an annotation after the function ran.
    // If this line is omitted and a dummy blob is returned, the error doesn't occur
    const arr = new Uint8Array(data);

    return new Blob([arr], { type: 'application/pdf' });
  }

Yes, Subject is empty (also i don’t know why this is the case. But the type is as expected Callout (or “Legende” how it is called in Germany).

1 Like

Hello Chris,

Thank you for the response.

I think we have enough information here. I will submit a bug report for our product team to review.

Best Regards,
Darian

1 Like