PDFExporter.getBase64()
Get exported PDF as a base64 string. Needs
export.methodExportsince 1.0.0
Signature
getBase64(options?: ExportOptions): Promise<string>
Parameters
| Parameter | Type | Description |
|---|---|---|
| options? | ExportOptions | { flatten?, invalidateSignatures?, pages?, onProgress?, signal? }. |
Returns
Promise<string>
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 base64 = await viewer.createExporter().getBase64();