title: Open as PDF ajax returned document
body: <p>Here is the code. "core/bcsheet.php" returns PDF document but ajax shows as html code. How can I show PDF to user?</p>
  
  <pre><code>function ajaxPost() {
      form = $("#dbview");
      formData = form.serialize();   
      formUrl = "core/bcsheet.php";
      formMethod = form.attr('method');
  
      $.ajax({
          url: formUrl,
          type: formMethod,
          dataType: "html",
          cache: false,
          data: formData,
          success: function (html) { 
              var win = window.open('', 'childWindow', 'location=yes, menubar=yes, toolbar=yes');
              win.document.open();
              win.document.write(html);           
              // win.print();
              win.document.close();         
          //win.close(); 
          }
      });   
  };
  </code></pre>