I am new to Javascript / jQuery and am looking for a way to add a button to a page that allows the user to create a pdf from a pre-defined form or div (e.g. by adding a class).
I did some research but could not find a way to do this in JS or jQuery.
Is there a way to realise this on client side via Javascript / jQuery or can someone tell me a freeware plugin that supports this ?
The only plugin I found is TCPDF but this seems to be pretty large and I did not see a way there where I can limit this to a certain form or div on a page (instead of printing the whole page).
Note: I do not need to cover images, just plain HTML like form fields or tables and text.
Many thanks in advance for any help with this, Mike
you could try with jsPDF
it's free and client side.
You can see from their 'HTML Render' example that you can create a PDF from a portion of your HTML
EDIT
Probably jsPDF doesn't support CSS
If you need it, you could try as an alternative phantomJS, but it's a command-line tool and it captures a web page as a screenshot. Not sure if that's what you're searching for
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With