Web SDKv1.0.0

PDFExporter.getBlob()

Get exported PDF as a Blob. Needs export.
methodExportsince 1.0.0

Signature

getBlob(options?: ExportOptions): Promise<Blob>

Parameters

ParameterTypeDescription
options?ExportOptions{ flatten?, invalidateSignatures?, pages?, onProgress?, signal? }.

Returns

Promise<Blob>

Throws

  • FEATURE_NOT_LICENSED when the license lacks export.
  • INVALID_ARGUMENT when pages is empty or names a page the document does not have.
  • INVALID_STATE when flatten is asked of a signed document without invalidateSignatures; from a viewer's exporter, when pending edits cannot be written or the document was reloaded under it.
  • PAGE_ERROR when a page cannot be loaded for flattening.
  • EXPORT_FAILED when the document cannot be written.
  • ABORTED when signal aborts.
  • DOCUMENT_CLOSED after doc.close().

Example

TypeScript
const blob = await viewer.createExporter().getBlob();
const form = new FormData();
form.append('file', blob, 'report.pdf');

More in PDFExporter