jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

webpage image to pdf

Open manjari188 opened this issue 9 years ago • 3 comments

Is it possible to capture image of the web page and convert it into pdf?

manjari188 avatar Jan 04 '17 12:01 manjari188

Yes, you need to use Html2Canvas, they have a little example that shows you how to use it. Basically all you need to do is get the Body element with Jquery or Javascript convert it to Canvas and use addImage() function in your PDF and you'll be ready to go.

Maybe im wrong but that's how i would do it.

p-rez avatar Jan 04 '17 16:01 p-rez

Can you provide a link to the code or some example? Thank you

Abuitime avatar Jan 25 '17 19:01 Abuitime

Hi @manjari188 and @Abuitime, I've created html2pdf for exactly this purpose. It uses html2canvas and jsPDF to create a PDF from HTML. Try it out - if you have any problems with it, feel free to open an issue over there!

eKoopmans avatar Apr 13 '17 14:04 eKoopmans