title: Exporting the webpage into pdf file
body: <p>I am trying to export the webpage(not whole page, but some part of page) into <code>pdf file</code> when user click the button.</p>
  
  <p>But the below code is not working for me. Can any one please help me where I went wrong. I am using <code>jsPDF</code> to export the web page into <code>pdf</code>.</p>
  
  <pre><code> &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
          &lt;title&gt;Untitled Document&lt;/title&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js/jspdf.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="libs/Deflate/adler32cs.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="libs/FileSaver.js/FileSaver.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="libs/Blob.js/BlobBuilder.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jspdf.plugin.addimage.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jspdf.plugin.standard_fonts_metrics.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jspdf.plugin.split_text_to_size.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jspdf.plugin.from_html.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              $(function() {
                  var doc = new jsPDF();
                  var specialElementHandlers = {
                      '#editor': function(element, renderer) {
                          return true;
                      }
                  };
  
                  $('#cmd').click(function() {
                      doc.fromHTML($('#content').html(), 15, 15, {
                          'width': 170,
                          'elementHandlers': specialElementHandlers
                      });
                      doc.save('sample-file.pdf');
                  });
              });
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="content"&gt;
              &lt;h3&gt;Hello, this is a H3 tag&lt;/h3&gt;
  
              &lt;p&gt;a pararaph&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="editor"&gt;&lt;/div&gt;
          &lt;button id="cmd"&gt;generate PDF&lt;/button&gt;
      &lt;/body&gt;
  
   &lt;/html&gt;
  </code></pre>