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