PDF Annotation Statuses

The annotation statuses/states provide a built-in way to create review and approval workflows. The default states are: Accepted, Rejected, Cancelled, Completed, and None. These statuses are part of PDF specification which is why they are included as the default. However, it is possible to customize this list.

Apryse Docs Image

Programmatically update annotation state

We can set the annotation state programmatically by calling updateAnnotationState.

JavaScript (SDK v8.0+)

1WebViewer(...)
2 .then(instance => {
3 const { documentViewer, annotationManager, Annotations } = instance.Core;
4
5 documentViewer.addEventListener('annotationsLoaded', () => {
6 const annotList = annotationManager.getAnnotationsList();
7 const annot = annotList[0];
8 annotationManager.updateAnnotationState(annot, 'Completed');
9 });
10 });

Customizing states

With WebViewer 11.13+, you can customize which annotation statuses appear in the Notes Panel status filter by using the setStatusList API. Pass an array of statuses from UI.NotesPanel.StatusList to control which options are shown.

JavaScript

1WebViewer(...)
2 .then(instance => {
3 const { StatusList } = instance.UI.NotesPanel;
4 instance.UI.NotesPanel.setStatusList([
5 StatusList.ACCEPTED,
6 StatusList.REJECTED,
7 ]);
8 });

To reset the status list and show all available statuses, pass all values from UI.NotesPanel.StatusList.

JavaScript

1WebViewer(...)
2 .then(instance => {
3 const { StatusList } = instance.UI.NotesPanel;
4 instance.UI.NotesPanel.setStatusList(Object.values(StatusList));
5 });

Relevant APIs

updateAnnotationState
To update annotation state.

getState
To get annotation state.

getStateModel
To get annotation state model.

setState
To set annotation state.

setStateModel
To set annotation stateModel.

setStatusList
To customize the available annotation statuses.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales