Which product are you using?
PDF.js Express Version
Detailed description of issue
Hi,
I was trying to figure out how I could generate a pdf then retrieve it from the viewer and send it to a server to be emailed. Bonus: I’m doing this in Blazor so essentially I’m restricted as to what I can do.
Expected behaviour
_________^^^^^^^^^ Nice Canadian Spelling!!!
Generate a report and send it in an email.
Does your issue happen with every document, or just one?
Every one.
Link to document
NA
Code snippet
// I’m calling this javascript from a Blazor app to get the displayed PDF. It doesn’t
// return the PDF but I think it’s close
getPDF: (elementWanted) => {
const viewerElement = document.getElementById(elementWanted);
instance = getInstance(viewerElement);
const { documentViewer } = instance.Core;// must wait for the document to be loaded before you can save the file documentViewer.addEventListener('documentLoaded', async () => { const documentStream = documentViewer.getDocument().getFileData({}); const documentBlob = new Blob([documentStream], { type: 'data:application/pdf' }); return(documentBlob); }) }
Thanks
Craig