留言板
Convert html page to pdf
Hi,
I need to convert one html page which contains different google charts + some static content in <div> tags. Requirement is to use open source library to convert html to pdf and not the paid one. Currently I am using JSPDF(https://parall.ax/products/jspdf) library.
Now the problem is using JSPDF, I am not getting the exact pdf same as html page. Some graphs are not coming properly and some are not coming at all. Means lot of problems I am facing. I searched a lot and found so many options(pdf.js, itext, pd4xml, etc) and tried everything but not able to resolved.
PFA html page which needs to be converted in pdf. Just open html page in browser for seeing the output. It contains one button called "Download as pdf", clicking on the same will generate the pdf. Expected output is pdf should contain same output shown in html page.
Any help would really be appreciated.
Thanks and Regards,
Abdulbasit F Shaikh.
I need to convert one html page which contains different google charts + some static content in <div> tags. Requirement is to use open source library to convert html to pdf and not the paid one. Currently I am using JSPDF(https://parall.ax/products/jspdf) library.
Now the problem is using JSPDF, I am not getting the exact pdf same as html page. Some graphs are not coming properly and some are not coming at all. Means lot of problems I am facing. I searched a lot and found so many options(pdf.js, itext, pd4xml, etc) and tried everything but not able to resolved.
PFA html page which needs to be converted in pdf. Just open html page in browser for seeing the output. It contains one button called "Download as pdf", clicking on the same will generate the pdf. Expected output is pdf should contain same output shown in html page.
Any help would really be appreciated.
Thanks and Regards,
Abdulbasit F Shaikh.
Because it's not going to work. google charts is javascript running in the browser. As long as you're using a javascript lib for your charting, you're going to find it practically impossible to render into a PDF file.
I used Flying Saucer in my old times succesfully:
https://code.google.com/p/flying-saucer/
Said that, depending on how those graphs are rendered it would work or not. You can give it a try...If not you could change those graphs to be rendered as simple <img>, in that case that should work.
https://code.google.com/p/flying-saucer/
Said that, depending on how those graphs are rendered it would work or not. You can give it a try...If not you could change those graphs to be rendered as simple <img>, in that case that should work.