-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF quality with html2canvas scale returns a blank pdf #128
Comments
Did you manage to fix this? |
No, but I think I found the source of the issue. I believe it has something to do with the toDataURL() and data URI limits, since I have seen through debugging incomplete values which don't render properly. I wanted to do some testing by splitting up images in the middle of the lib flow but had to work on other issues. Hope it helps someone to fix this. (one idea would be to have classes that would render straight to svg and pdf - not going through html2canvas - and the rest would be done with images) |
Hi @talkshowhost and @Greensahil, sorry I've been absent. It's a problem related to the maximum canvas width/height - see here. One possible solution; html2canvas allows you to specify your own canvas, rather than create its own. It may be possible to create a "virtual" canvas object that acts like a canvas, but in fact stitches together multiple canvases if the max size is exceeded. Regarding the smart pagebreaks - I'm on the case, looking at merging the various suggestions now. |
@talkshowhost for page-breaks, I've made a new PR #153 with a proposed upgrade, I'll merge it in after some testing. |
@eKoopmans when are planning to to solve this issue of Maximum canvas size. What i am doing is making 14 pdfs at time and again using same jsPDF object to add more pages. But cpu utilization and memory consumption increases too much when doing such operation for like 15 times. |
Hi,
I've been trying to get the best possible quality and I've only been able by increasing the scale property on html2canvas. The best results I had were with 5, even though I'm not sure exactly which values I should use.
The problem is when the PDF has more than a certain number of pages it returns with all of them blank. At the moment with 16 pages I can use the value with 2. If they increase I have to decrease this value to 1.5 and so on.
Is there another way to do this or to fix this issue?
PS: I've seen the requests for a smart break functionality and there is a fork with it from App1e5auce, if this could be merged would be awesome :)
The text was updated successfully, but these errors were encountered: