title: How to open jsPDF in modal
body: <p>I have this code to generate my PDF files using jsPDF library:</p>
  
  <pre><code>// JSPDF, docs: http://rawgit.com/MrRio/jsPDF/master/docs/global.html   
  
                                              // Default export is a4 paper, portrait, using milimeters for units
                                              var doc = new jsPDF()
  
                                              // set font size
                                              doc.setFontSize(12);
  
  
                                              doc.text("Invoice #" + row["client_id"],10,10);
                                              doc.text("Name: " + row["name"],10,14);
                                              doc.text("Gender: " + row["gender"], 10, 18);
                                              doc.text("Company: " + row["company"], 10, 22);
  
                                              //doc.save("a4.pdf");   
  
                                              doc.autoPrint();
                                              doc.output("dataurlnewwindow");
  </code></pre>
  
  <p>¿It´s possible to open in modal window?</p>
  
  <p>Using this script:</p>
  
  <pre><code>$.ajax({
  type : "POST",
  url : getPrintablePDF,
  dataType : "json",
  contentType : 'application/json; charset=utf-8',
  data : JSON.stringify(params),
  success : function(data) {
      var myResponse = eval(data);
      $("&lt;iframe /&gt;") // create an iframe
        // add the source
        .attr('src', 'data:application/pdf;base64,' + myResponse.base64EncodedResponse)
        .appendTo('.modal-body'); // append to modal body or wherever you want
  }}); 
  </code></pre>
  
  <p>Thank you!</p>