title: Printing HTML + Multiple PDF files with Javascript
body: <p>I've got a project where I'm needing to print the HTML page the user is on, as well as multiple PDF files (multiple prompts is OK)</p>
  
  <p>After hunting around on Google and Stackoverflow I found <a href="https://stackoverflow.com/questions/7187400/printing-multiple-pdf-files-using-javascript">Printing multiple PDF files using JavaScript</a> which is close, but not quite working.</p>
  
  <p>The code below prints the HTML page fine, and creates a print prompt for the PDF, but the PDF print prompt is for a blank page.</p>
  
  <p>I've triple checked the example address and the fine is definitely at <a href="http://www.mydomain.co.nz/wp-content/uploads/Golden-China1.pdf" rel="nofollow noreferrer">http://www.mydomain.co.nz/wp-content/uploads/Golden-China1.pdf</a>.</p>
  
  <p>Anyone spot what I'm doing wrong?</p>
  
  <pre><code>function PrintAll(file1, file2, file3) {
      window.print();
      var pages = [file1, file2, file3];
      for (var i = 0; i &lt; pages.length; i++) {
          if (pages[i] != undefined) {
              var oWindow = window.open(pages[i], "print");
              oWindow.print();
              oWindow.close();
          }
      }
  }
  
  $('.print-btn').click(function() {
      PrintAll('/wp-content/uploads/Golden-China1.pdf');
  });
  </code></pre>