Skip to content
ComPDF
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

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)