Build Your Own Client
Intro
While DocViewer has its own client for viewing and annotating documents, there are cases (such as creating a mobile app) when you may wish to create your own client, but use DocViewer for document conversion and to store annotations.
The benefits of this are:
- Documents and annotations can be accessed from any client. Create a document, add annotations in your custom client, then view on the web in DocViewer's client, and the annotations will still be there.
- We'll handle document conversion for you. Pass in any of our supported filed types and we'll convert it to PDF.
- We'll store all the data. Just remember the Document ID, and your user information, and we'll keep track of the rest.
The first couple steps are the same as when using the DocViewer Client. The basic flow here is that you'll:
- Create a document
- Launch a Session
- Download the Converted PDF
- Make API requests to GET and PUT annotations
Using the API for Annotations
DocViewer does not follow the XFDF standard for annotations. The standard was supported in the past, but it quickly became apparent that the standard was broken, so support was dropped. As such, there is some XFDF terminology in the API, though DocViewer uses it differently.
Review the list of annotation types. Each annotation requires different attributes.
Review the annotation endpoints. The GET endpoint is used to get all annotations for a given document, and the PUT endpoint is used to create and update annotations.