Skip to content

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Show or Hide Annotations ​

For annotations in WebViewer, sometimes you want to show or hide them, you can set with the annotationManager. Note that this only affects the visibility of annotations in WebViewer and does not impact their actual visibility in the PDF.

Show Annotations ​

You can use the showAnnotations method of the annotationManager to display annotations.

javascript
const annotationManager = docViewer.getAnnotationManager()
const annotationsList = annotationManager.getAnnotationsList()
docViewer.showAnotations(annotationsList)

Hide Annotations ​

You can use the hideAnnotations method of the annotationManager to hide annotations.

javascript
const annotationManager = docViewer.getAnnotationManager()
const annotationsList = annotationManager.getAnnotationsList()
docViewer.hideAnotations(annotationsList)