Is there any reliable method to convert webpages to pdf using javascript or any API's. I"ve this page where we have a button, which should download the page as pdf on click. I've tried with couple of libraries like jsPDF, but CSS inclusion was a concern. I've certain content in the page as display: none which shouldn't get rendered for the generated pdf. Appreciate any insights on this. Thanks!
Asked
Active
Viewed 113 times
0
-
As far as I know, external CSS support for dynamic PDF generation is very low. Your best bet is to use inline style. As for me, I'd rather just display the page to be printed and put button to open print dialog, user can choose print to PDF as the printer. – Christhofer Natalius Aug 24 '21 at 08:06
-
I tried the same few years ago. At the end it is not possible. – Thallius Aug 24 '21 at 08:18
-
Does this answer your question? [Is it possible to save HTML page as PDF using JavaScript or jquery?](https://stackoverflow.com/questions/6896592/is-it-possible-to-save-html-page-as-pdf-using-javascript-or-jquery) – HanaTam Aug 24 '21 at 08:19
-
@HanaTam I don't see any workarounds in this thread rather than using an image of the page and embedding it in the PDF. Are you anyhow aware/used any API's w.r.t this? – Jezwin Varghese Aug 24 '21 at 08:26