Generate pdf from HTML in div using Javascript
09:47 12 Aug 2013

I have the following html code:



    
        

don't print this to pdf

print this to pdf

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"

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.

javascript jspdf