title: How can i print a pdf in google chrome?
body: <p>I have a pdf associated with a button . When i click the button i want to get the pdf printed. This is how my button is coded :</p>
  
  <pre><code>&lt;input type="submit" class="btn-red" value="Print"
  name="Submit" id="printbtn"
  onclick="printPDF('http://www.irs.gov/pub/irs-pdf/fw4.pdf')" /&gt;
  </code></pre>
  
  <p>Now my print functionality works like this :</p>
  
  <pre><code>    function printPDF(pdfUrl)
      {
  
      if ((navigator.appName == 'Microsoft Internet Explorer') ) 
      window.print(pdfUrl,"_self");
      else
      {
      var w = window.open(pdfUrl,"_self");
      w.print();
      w.close();
      }
      }
  </code></pre>
  
  <p>The problem is , it's working fine in IE and Fire fox , but does not work in chrome. In ie and Firefox, it opens up the xps printer option, but in chrome , it just opens up  a new print window, with the print preview of the div and not the pdf . But i want the xps option to be opened up here.</p>
  
  <p><strong>EDIT :</strong> In chrome when i try to print , only the html element comes as preview and not the pdf. I am using chrome version : 20.0.1132.57</p>
  
  <p>How can i get around this peculiarity ? kindly help .</p>