Web SDKv1.0.0

PDFDocument.close()

Close the document and free its resources; resolves once they are released. A viewer still open on it refuses undo, redo, snapshot() and Download with a reported DOCUMENT_CLOSED (its exporter rejects with it): destroy the viewer, or open a new document. After Kernstra.destroy() has recovered from an ENGINE_FAILED fault the document is already released, and close() does nothing.
methodLifecyclesince 1.0.0

Signature

close(): Promise<void>

Returns

Promise<void> Resolves once its resources are released.

Example

TypeScript
viewer.destroy();
await doc.close();

More in PDFDocument