Skip to content

显示或隐藏注释

在 WebViewer 中显示的注释,有时我们需要显示或隐藏这些注释,可以使用 annotationManager 来实现,需要注意只是在 WebViewer 中显示或隐藏,不影响实际在 PDF 中的显示或隐藏。

显示注释

可以通过 annotationManager 中的 showAnotations 方法来显示注释

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

隐藏注释

可以通过 annotationManager 中的 hideAnotations 方法来显示注释

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