title: JSP To PDF Converter By jsPDF
body: <p>I am trying to convert my jsp page output into PDF. For this, I am trying <code>jsPDF</code> API. I did some R&amp;D and wrote the code for the same. There is a PDF getting open but it is blank.
  Need some help.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/examples/js/jquery/jquery-1.7.1.min.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/jspdf.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/addimage.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/cell.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/from_html.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/javascript.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/split_text_to_size.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;jsPDF/plugins/standard_fonts_metrics.js&quot;&gt;&lt;/script&gt;
  
  &lt;body id=&quot;target&quot;&gt;
  
  &lt;div&gt;
      &lt;button id=&quot;downloadFile&quot; value=&quot;Download PDF&quot; type=&quot;button&quot;&gt;Download PDF&lt;/button&gt;
  
  &lt;/body&gt;
  
      var specialElementHandlers = {
                  '#editor': function (element,renderer) {
                      return true;
                  }
              };
      
          $('#downloadFile').click(function () {
              var doc = new jsPDF();
              var source = $('#target').html();
              var specialElementHandlers = {
                  '#bypassme': function (element, renderer) {
                      return true;
                  }
              };
              doc.fromHTML(source, 0.5, 0.5, {
                  'width': 75,'elementHandlers': specialElementHandlers
              });
              doc.output(&quot;dataurlnewwindow&quot;);
              doc.save('E:/Test.pdf');
          });
  </code></pre>
  <p>For <code>doc.save('E:/Test.pdf');</code>, there is an alert says that:</p>
  <blockquote>
  <p>&quot;Error in function jsPDF/output: saveAs is not defined&quot;</p>
  </blockquote>
  <p>Tell me that what am I doing wrong ?</p>