I have a PDF file as a Blob object (generated using jsPDF ) that I want to display in the <iframe>
element.
I can do this easily as follows:
iframe.src = URL.createObjectURL( blob )
PDF is processed correctly, but instead of its name I get an esoteric string (see the image below in the Chrome PDF viewer application).
So, I tried to convert the Blob to a File object to give it a human-readable name.
var file = new File( [blob], 'a_name.pdf', { type: 'application/pdf' } ) iframe.src = URL.createObjectURL( file )
It works with Firefox: the name is saved when the file is saved from the PDF view header. Unfortunately, it is deleted in Chrome and replaced with an arbitrary file name before downloading to the PDF viewer.
Do you know if it is possible to display a PDF file object in an <iframe>
with its name?
source share