title: Is it possible to render PDF (fPDF) via a javascript?
body: <p>So, I'm passing some values via jQuery to the server, which generates PDF garble. It goes something like this:</p>
  
  <pre><code>$.post('/admin/printBatch',
  data, // Some vars and such
  function(data){
      if(data) {
  
          var batch =  window.open('','Batch Print','width=600,height=600,location=_newtab');
          var html = data; // Perhaps some header info here?!
          batch.document.open();
          batch.document.write(html);
          batch.document.close();
  
          $( this ).dialog( "close" ); // jQuery UI
      } else {
          alert("Something went wrong, dawg.");
      }
      return false;
  });
  </code></pre>
  
  <p>The output file looks roughly like so:</p>
  
  <pre><code>$pdf-&gt;AddPage(null, null, 'A PDF Page');
  //....
  $pdf-&gt;Output('', 'I'); // 'I' sends the file inline to the browser (http://fpdf.org/en/doc/output.htm)
  </code></pre>
  
  <p>What gets rendered to the browser window:</p>
  
  <pre><code>%PDF-1.3 3 0 obj &lt;&gt; endobj 4 0 obj &lt;&gt; stream ...
  </code></pre>
  
  <p>I'm missing something major, I just know it... thoughts?</p>
  
  <p>Thanks, guys.</p>