title: How to send a pdf file directly to the printer using JavaScript?
body: <p>How to send a PDF file directly to the printer using JavaScript?</p>
  
  <p>I found two answers in a forum:</p>
  
  <pre><code>&lt;embed src="vehinvc.pdf" id = "Pdf1" name="Pdf1" hidden&gt;
  &lt;a onClick="document.getElementById('Pdf1').printWithDialog()" style="cursor:hand;"&gt;Print file&lt;/a&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;OBJECT id = "Pdf2" name="Pdf2" CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="364" HEIGHT="290"&gt;
       &lt;PARAM NAME='SRC' VALUE="file.pdf"&gt;
  &lt;/OBJECT&gt;
  &lt;a onClick="document.Pdf2.printWithDialog()"&gt;Print file&lt;/a&gt; 
  </code></pre>
  
  <p>But my problem is that it just works on IE, and doesnt work in Firefox or Chrome.</p>
  
  <p>Is there any solution for this?</p>