-
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
.html function seem to be broken #2575
Comments
Same issue here. Anyone? |
even i am facing the same issue Font size is too big |
Maybe related to #2781? Please test again with the current master branch. |
I'm facing the same issue as OP. If I pass this option |
@trangthule Are you using [email protected] and [email protected]? If yes, please share your code and html. |
@trangthule you'll need to calculate the scale based on the scrollWidth, |
Thanks for the reply. But I don't get the formula for calculating the scale. Here is my code on JsFiddle. The HTML element that I want to convert to pdf is 600px. 595.28/600 = 0.9921. If I use this number, the text will still get cut off. |
Which browser did you try? looks okay from my end. Well, you do have a different issue though. |
That example works because I had changed my scale formula:
If I used the formula 592.28 / srcwidth, I'll get 0.9921. The text was cut off a bit. |
Sure, if you add the margin, you'll need to subtract that. |
Thank you for your help. I'm getting there. And how do I set a margin? I can only set x and y. Setting a margin like [10, 10, 10, 10] doesn't seem to make an effect. I've been digging through everything regarding jspdf on Stackoverflow and I think you answered a question there in 2019 that it was not possible yet. |
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant. |
try to change the unit like: |
@sdhoddusamy have u found any solution for this problem ? |
I'm using jsPdf version 1.5.3 and html2Canvas version 1.0.0-rc1 .
When I use .html to download components of my web page into pdf the results are totally unexpected.
Here is my code:
var doc = new jsPDF({
orientation: 'p',
unit: 'mm',
format: 'a4'
});
doc.html(allWarnings, {
callback: function (doc) {
doc.save('web.pdf');
}
});
Please help
The text was updated successfully, but these errors were encountered: