Some test text!

menu
Remove annotationskeyboard_arrow_down

Remove annotations in viewer

Many users will remove or delete annotations using the WebViewer UI. The simplest way to do this with the WebViewer UI is to select the annotation and choose the delete/trash icon in the popup modal.

annotation popup

linkProgrammatically

Annotations can also be deleted programmatically. You'll want to make sure that the annotations have already been loaded in the viewer.

For example to remove it immediately after the annotations are loaded then use the annotationsLoaded event:

WebViewer(...)
  .then(instance => {
    const { docViewer, annotManager } = instance;

    docViewer.on('annotationsLoaded', () => {
      const annots = annotManager.getAnnotationsList();

      // remove annotations
      annotManager.deleteAnnotations(annots);
    });
  });

Customize or modify a PDF before saving
Full sample code demonstrating how to customize document save/download. In the example, annotations are deleted for rerendering and flattened before saving.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.