Show and Hide annotations does not work properly

Hi Team,

Consider two annotated documents “A.docx” and “B.docx”. Now I have hidden the annotation of document “A” with annotationManger.hideAnnotations() and trying to preview document “B” with annotationManger.showAnnotations(), but the “annotationChanged” event does not trigger and hence unable to view the annotations of that document. Now, when I try to preview A.docx once again, “annotationChanged” event gets triggered and annotations are visible. Please help me to sort out the issue. Thanks.

Gowtham C

Hi Gowtham,

Please let me know if I am interpreting your question correctly as I am slightly confused.

My interpretation of the steps to reproduce the issue you are describing:

  1. Load A.docx into WebViewer

  2. wait for the annotations loaded event

  3. call annotationManger.hideAnnotations(annotsToHide)

  4. the specified annots are hidden in A.docx

  5. load B.docx

  6. wait for the annotations loaded event

  7. call annotationManger.showAnnotations(annotsToShow) (What is the reasoning behind calling this function? Are we trying to show the annots from step 3? Does the file have annots hidden by default? Why do we care about the annotationChanged event?)

  8. load A.docx again

  9. I don’t quite follow: annotationChanged" event gets triggered and annotations are visible. Can you elaborate?

Anthony Chen

Software Developer
PDFTron Systems Inc.