Some test text!

Getting started

Running samplesTry demo in your projectDownloading PDFTronIntegrating PDFTron via GradleManually integrating PDFTronUpgradingAdding PDFTron license keyUsing ProGuardTroubleshooting integration


Document lockingSaving PDF documentsUnderstanding coordinates


Using an ActivityUsing a FragmentUsing PDFViewCtrlViewer configConverting and viewing other document typesConverting HTML to PDF


PDFViewCtrl color modesPDFViewCtrl page view modePDFViewCtrl page presentation modeGenerating thumbnails in PDF


Day/Night themesUndo and redoText searchAnnotation syncingRotating PDF pagesPDFViewCtrl read onlyUsing PDFViewCtrl with minimum memory


Tools overviewSetting Up ToolManagerChanging and disabling toolsIntercepting annotation handlingToolManager eventsDefault annotation propertiesTool subclasses



UI components

Quick menuAnnotation toolbarAnnotation style dialogThumbnail sliderAnnotations listOutline listUser bookmarks listBookmarks dialogPage thumbnails dialogAdd page dialogRotate pages dialogView mode dialogCrop page dialogReflow


Adding a custom view to a PDF pageCustom toolCustomizing quick menuCustomizing annotation style dialog


Running project in Android StudioSystem RequirementsPDFTron full vs. standardLocalizationIcon cheat sheetRunning sample with sourceReducing size of APKEnable multidexOut of memory when rotating device multiple timesDetachCurrentThread warning

PDF Processing API

What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
Annotation syncingkeyboard_arrow_down

Annotation syncing

In this document
chevron_rightInitializing and sending annotation changes
chevron_rightReceiving annotation changes
chevron_rightJump to annotation

PDFNet supports annotation syncing between different clients to allow for collaboration. All the required locking, change tracking, merging and view updating are handled internally. Below are instructions on how to handle the import and export of annotation changes on the client side. While the server component is not described here, that implementation would be straightforward. The server would receive XFDF XML data, which it would then pass onto all other active clients that are part of the collaboration session. The clients take care of the updating. The server can store any XFDF data as it likes, since the data is just an XML string.


Here are a few requirements for syncing to work as expected:

  • A permanent and unique string identifier is needed for the userId. UserId needs to be permanent and cannot be changed later on. For example, if Alice was used for the userId, however, was later changed to AliceB, the viewer will no longer treat it as the same user. Therefore, we recommend that you generate a UUID for each user.
  • Similar to userId, each annotation will also need its own UUID, aka annotId. This UUID also needs to be permanent and unique.
  • Annotation changes are stored as XFDF command strings, which PDFNet generates when changes are made. However, any custom modification to the XFDF command string could lead to unexpected results, thus, modification to the XFDF command string are not recommended.
  • Existing annotations that do not have a unique identifier will not work, it is recommended that you pre-process all annotations to make sure they all have unique identifiers.
  • Undo and redo will be automatically enabled upon using annotation syncing.

linkInitializing and sending annotation changes

Add the following after ToolManager is initialized:

PDFNet will generate a unique identifier for every annotation created through the PDFTron SDK. However, if you would like to generate your own annotation identification, you are able to do so as follows:

linkReceiving annotation changes

When an annotation change event is received from a remote service, add the following to notify the viewer about the change:

linkJump to annotation

To jump to an annotation by id: