title: How to display a javascript File object in Chrome's PDF viewer with its name?
body: <p>I've got a PDF file in the form of a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob" rel="noreferrer">Blob</a> object (generated with <a href="https://github.com/MrRio/jsPDF" rel="noreferrer">jsPDF</a>), that I want to display in an <code>&lt;iframe&gt;</code> element.</p>
  
  <p>I can do that easily this way:</p>
  
  <pre><code>iframe.src = URL.createObjectURL( blob )
  </code></pre>
  
  <p>The PDF is rendered correctly but I get an esoteric string in place of its name (see image below of Chrome's PDF viewer).</p>
  
  <p>So I tried to convert the Blob to a <a href="https://developer.mozilla.org/en-US/docs/Web/API/File" rel="noreferrer">File</a> object in order to give it a human-readable name. </p>
  
  <pre><code>var file = new File( [blob], 'a_name.pdf', { type: 'application/pdf' } )
  iframe.src = URL.createObjectURL( file )
  </code></pre>
  
  <p>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.</p>
  
  <p>Do you know if it is possible to display the PDF File object in the <code>&lt;iframe&gt;</code> with its file name?</p>
  
  <p><a href="https://i.stack.imgur.com/eWxBB.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/eWxBB.jpg" alt="Chrome&#39;s PDF viewer"></a></p>