title: A HTML to PDF converter button using jspdf
body: <p>The PDF generator button in my html webpage is not working. Can someone please explain where I am going wrong?</p>
  
  <p>I am using jquery version 1.7.2.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Print Fax View&lt;/title&gt;
  &lt;meta content="text/html; charset=utf-8" http-equiv=Content-Type&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; 
  &lt;script type="text/javascript" src="js/jquery"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.standard_fonts_metrics.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.split_text_to_size.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.from_html.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="jspdf/libs/Deflate/adler32cs.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/libs/FileSaver.js/FileSaver.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/libs/Blob.js/BlobBuilder.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jspdf/jspdf.plugin.addimage.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/basic.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          var specialElementHandlers = {
              '#editor': function (element,renderer) {
                  return true;
              }
          };
          $('#cmd').click(function () {
              var doc = new jsPDF("p",in,"a4");
              var source = $('#target').html();
              var specialElementHandlers = {
                  '#bypassme': function (element, renderer) {
                      return true;
                  }
              };
              doc.fromHTML(source, 0.5, 0.5, {
                  'width': 7.5,'elementHandlers': specialElementHandlers
              });
              doc.output("dataurlnewwindow");
          });
      });
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body id="target"&gt;
           &lt;button id="cmd"&gt;generate PDF&lt;/button&gt;
           &lt;div&gt; &lt;p&gt;Hello World &lt;/p&gt; &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It is not generating anything.
  Thanks in advance</p>