html2pdf.js icon indicating copy to clipboard operation
html2pdf.js copied to clipboard

for large number of pages the plugin is not working to create pdf

Open hermione-e opened this issue 3 years ago • 2 comments

for pages more than 70 the plugin is not generating pdf also the css footer properties are getting tampered.

hermione-e avatar Oct 17 '22 05:10 hermione-e

html2pdf.js creates one single html canvas with all of the content and then converts that to a pdf. The problem is that browsers have a limit on how big a canvas can be, so for large documents the pdf ends up just being blank.

html3pdf, which is a fork of this library and shouldn't require any changes to your code, solves this by rendering each page on its own canvas (although this is much slower).

davidnbooth avatar Aug 09 '23 19:08 davidnbooth

html2pdf.js creates one single html canvas with all of the content and then converts that to a pdf. The problem is that browsers have a limit on how big a canvas can be, so for large documents the pdf ends up just being blank.

html3pdf, which is a fork of this library and shouldn't require any changes to your code, solves this by rendering each page on its own canvas (although this is much slower).

I tried to import it but it didn't work. It always says html2pdf is not defined.

xUrCodeBuddyx avatar Feb 04 '24 21:02 xUrCodeBuddyx