PDFExporter.getBlob()
Get exported PDF as a
Blob. Needs export.methodExportsince 1.0.0
Signature
getBlob(options?: ExportOptions): Promise<Blob>
Parameters
| Parameter | Type | Description |
|---|---|---|
| options? | ExportOptions | { flatten?, invalidateSignatures?, pages?, onProgress?, signal? }. |
Returns
Promise<Blob>
Throws
FEATURE_NOT_LICENSEDwhen the license lacksexport.INVALID_ARGUMENTwhenpagesis empty or names a page the document does not have.INVALID_STATEwhenflattenis asked of a signed document withoutinvalidateSignatures; from a viewer's exporter, when pending edits cannot be written or the document was reloaded under it.PAGE_ERRORwhen a page cannot be loaded for flattening.EXPORT_FAILEDwhen the document cannot be written.ABORTEDwhensignalaborts.DOCUMENT_CLOSEDafterdoc.close().
Example
TypeScript
const blob = await viewer.createExporter().getBlob(); const form = new FormData(); form.append('file', blob, 'report.pdf');