-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
autoPaging: 'text' messes up lineheights #3403
Comments
look at using the html2pdf library instead of jspdf. autopaging works with it |
thx for the tipp but htm2pdf uses html2canvas and creates an image embedded in the pdf.. so i get 400k files instead of 4k files and you can not select the text.. or did i miss an option to create a real "text - pdf" |
try not setting the bottom margin. i noticed having autopaging set to text and margin bottom 0, it would work sometimes |
unfortunately this doesn't help.. i've been doing 2 hours of trial and error and played with all settings i could find. BUT i was finally able to find something that at least points into the right direction it's the amount of pages !???the more pages the final pdf is going to have the bigger is the top margin (or line-height) for < em > or < strong > the attached txt file contains example code that produces the effect.. if you remove one of the lines with the dummy text the unwanted offset will get smaller .. if you remove all 3 of them and therefore reduce the final pdf to one single page the effect is gone. |
Thanks for the bug report. A pull request would be very welcome. |
Hello, is there any fix for this? |
This isn't really solving the original problem but it does help. It might be better to update html2canvas and add option to reorder elements based on their vertical position. I am not sure however if that is possible and what other problems that might cause. |
Hi, facing the same issue as well. |
"I have read and understood the contribution guidelines.".
HTML
JSPDF
As you can see in the following screenshots the < em > and the < strong > tags as well as < code >< pre > tag are messed up somehow.
autoPaging: slice 👍
autoPaging: text 👎
i am using
"jspdf": 2.5.1
"node": 16.13.2
The text was updated successfully, but these errors were encountered: