Print PDFs from a Blob Using JavaScript
If you want to start printing a document loaded in a Blob
, create an object URL and provide that to the document
option in the configuration object passed to PSPDFKit.load()
.
Then, call instance.print()
when the SDK has loaded. The printing dialog should display, indicating the PDF has started printing:
const documentObjectUrl = URL.createObjectURL(blob); PSPDFKit.load({ document: documentObjectUrl // ... }). then(instance => { URL.revokeObjectURL(documentObjectUrl); // Print when loaded. // instance.print(); });