I've got a PDF file in the form of a Blob object (generated with jsPDF), that I want to display in an <iframe>
element.
I can do that easily this way:
iframe.src = URL.createObjectURL( blob )
The PDF is rendered correctly but I get an esoteric string in place of its name (see image below of Chrome's PDF viewer).
So I tried to convert the Blob to a File object in order 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 kept when saving the file from the header's PDF viewer. Unfortunately it is dropped in Chrome and replaced with a random file name before being loaded in the PDF viewer.
Do you know if it is possible to display the PDF File object in the <iframe>
with its file name?