title: Generate pdf from HTML in div using Javascript
body: <p>I have the following html code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;p&gt;don't print this to pdf&lt;/p&gt;
          &lt;div id="pdf"&gt;
              &lt;p&gt;&lt;font size="3" color="red"&gt;print this to pdf&lt;/font&gt;&lt;/p&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>All I want to do is to print to pdf whatever is found in the div with an id of "pdf".  This must be done using JavaScript.  The "pdf" document should then be automatically downloaded with a filename of "foobar.pdf"</p>
  
  <p>I've been using jspdf to do this, but the only function it has is "text" which accepts only string values.  I want to submit HTML to jspdf, not text.  </p>