Display list of all annotations in document

The AnnotationDialogFragment displays a list of all annotations in a document being viewed by a PDFViewCtrl. The list also contains any comments that have been added to the annotations.

Apryse Docs Image

Show annotation dialog

To show an annotation dialog fragment in your activity, create a new instance of AnnotationDialogFragment by calling newInstance() and setting the PDFViewCtrl:

1BookmarksDialogFragment showBookmarksDialog(FragmentManager fragmentManager, PDFViewCtrl pdfViewCtrl) {
2 DialogFragmentTab annotationsDialog = new DialogFragmentTab(
3 AnnotationDialogFragment.class,
4 BookmarksTabLayout.TAG_TAB_ANNOTATION,
5 null,
6 "Annotations",
7 "Bookmarks Dialog",
8 null);
9 ArrayList<DialogFragmentTab> dialogFragmentTabs = new ArrayList<>();
10 dialogFragmentTabs.add(annotationsDialog);
11
12 BookmarksDialogFragment bookmarksDialog = BookmarksDialogFragment.newInstance();
13 bookmarksDialog.setPdfViewCtrl(pdfViewCtrl)
14 .setDialogFragmentTabs(dialogFragmentTabs);
15 bookmarksDialog.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.PDFTronAppTheme);
16 bookmarksDialog.show(fragmentManager, "bookmarks_dialog");
17 return bookmarksDialog;
18}

Listener

By calling setAnnotationDialogListener(AnnotationDialogListener), you can set a listener to be notified when an annotation item is clicked, or when document annotations are exported to a PDF doc when users click on the export floating action button.

Read-only

If the document has write access, users can delete existing annotations by long-pressing on the annotation. To specify whether the document is read-only call setReadOnly(boolean).

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales