Javascript: DocumentViewerController.downloadDocument Method
Description
Saves the current document and starts a browser download.
Syntax
<Promise.<void>> DocumentViewerController.downloadDocument([<StreamType> streamType], [<boolean> mergeFormFields], [<boolean> embedAnnotations])Parameters
| Parameter | Description |
|---|---|
| streamType | Optional. Requested output format. |
| mergeFormFields | Optional. Whether current form values are merged into the document. |
| embedAnnotations | Optional. Whether viewer annotations are embedded into the document. |
Return Value
Resolves after the browser download has been triggered.
Examples
The following example demonstrates TXDocumentViewer.downloadDocument in a practical Document Viewer workflow. Downloads the current document as an Adobe PDF document.
TXDocumentViewer.downloadDocument();
console.log("download document requested.");