exportDocument(documentURL, annotationURL, callback)

Use this method to generate a PDF document from the current document.

documentURL is a full URL string to the document and can be null if you are exporting the current document that is opened in the viewer.

annotationUrl is a full URL string to the annotations and can be null if you are exporting the current document that is opened in the viewer or if no annotations exist for the document.

If documentURL is null, annotationUrl is ignored.

If you export the current document that is opened in the viewer, the document and any annotations displayed in the viewer are exported.

callback is an object that must have three methods, which can be called by the export process:
  • onSuccess(downloadLocation): The export process calls this method when the export is successful and passes the download URL string to the exported document.
  • onError(errorMsg): The export process calls this method if the export finished with an error and passes the error message.
  • onStatusUpdate(message, error, pagesProcessed): The export process calls this method periodically as it checks for the export status. message is the progress status or is empty, error is a Boolean that indicates whether there was an error, pagesProcessed is the number of pages that are exported.

Syntax

exportDocument(documentURL, annotationURL, callback)

Sample syntax

exportDocument("http://myserver.com,/p1.tif", "http://myserver.com,/p1.tif", callback)