Javascript: PDF export button for web page

I need any pointers or resources where I can get a java script that allows my export button on my site to export my current page to pdf.

+6
source share
4 answers

I think there is no javascript library that would allow a PDF file to be created. Mozilla has implemented a complete PDF reader in js and includes it in the latest Firefox, but it is a huge library. EDIT : There is jspdf that seems to be able to do this.

I think you should go with the server side file system.

DOMPdf is a PHP library that allows you to display full HTML with CSS, images, etc. in the pdf document. He even has an example php script, which is placed on the server, allows you to convert the sent html to PDF.

Your javascript "button" should just get document.getElementsByTagName ('html') [0] .innerHTML and send this HTML to a DOMPdf script. From this you should get a more or less correct PDF.

+3
source

Follow the link Zend_Pdf: http://framework.zend.com/manual/1.12/en/zend.pdf.html

You can also try jspdf: http://jspdf.com/

+1
source

I can not get your request, I hope you need to take a pdf page.

if my understanding is correct, see link below

http://www.hiqpdf.com/demo/ConvertHtmlToPdf.aspx

also see existing ITextSharp HTML post in PDF?

thanks

+1
source

Use wkhtmltopdf for this purpose. I use it to create pdf html pages.

But this is not possible only with javascript. To do this, you must have the server-side code.

0
source

All Articles