-
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
Problem with Screen resolution and zoom in browser when generating pdf file from HTML with JSPDF and Html2Canvas #2766
Comments
I have similar issue where dowloading a pdf from a 3440x1440 px gets the text smaller in monitors with lower resolution. |
Seems related to #2781 |
Hi, Could you tell me please if this issue is already solved and available in the ZIP package? I would like to test (and thus retrieve the correct version of the libraries with the resolution). Thanks |
It's currently on the master branch. So if you download the zip on GitHub the fix should be included. |
Did you get a chance to test this? FYI, you'll probably need to use |
Hi, I tested with my text. But I obtain the pdf with a big margin (on the top) and the tables of my html page are not centered in the document as it is in the html. Could you please help me with that ? Here my code: https://github.com/amadese/PDFGenerator.git Thanks in advance for your help. |
I checked your test case and it works correctly for me if I use the correct jsdpf/html2canvas files. For the jsPDF files you need to run |
The big margin is caused by
|
Good catch! I guess we can just pass |
@HackbrettXXX Good point! will do. In the meantime, @amadese you can try pass scrollY from your
|
Thanks now the issue on the top margin is solved. |
Fix issue parallax#2766 margin-top issue with zoom-in'ed page
The reason the content is not in the center is that your scale is too small. Try |
Thank you very much it's working now :-) |
Thank you for getting back to me. @HackbrettXXX I guess this can be closed. |
Hi, It's me again. I'm using this version of jspdf: jspdf.pr2665.js (see the example on http://weihuiguo.com/) for getting a first example for creating the pdf file. My code there with the updates from this post:
It's working correctly after applying your comment from this page. If I replace jspdf.pr2665.js by jspdf.js from the folder src on the master branch, the code is not working (the error "pdf.html is not a function", could you help me please ? |
The |
Thanks but now when I'm using directly jspdf.umd.js, I obtained this error :"jsPDF is not defined" |
ah, we changed the name of the global variable -> |
Hi, I'm sorry but I'm new with this library. I don't know where I have to do the update in my code :-( |
Replace
with
|
Thank you so much, it's now working :-). |
Dear @HackbrettXXX , @kakugiki , I'm a little lost. In order to be sure to use the complete version of jspdf library (zll features) and for solving this issue, could you tell me please which file I should use for keeping all features of this library and the new updates for solving my problem? What is the difference between dist/jspdf.umd.js and jspdf.js in src ? If I use Thanks for your response and help. |
Hi how can i take the fixed code please. i am in need |
It's worked. |
it works. But in my case the text gets extra spaces and the font changes. everything is fine but the texts are not. why is that.? |
Hello. Is this issue with the Screen Resolution and Browser size resolved in the updates or not?
Any suggestions and discussions will be welcomed. |
I'm trying to create a script allowing to create a pdf file from an HTML page. I'm using the library jspdf, html2canvas and jquery. It's working correctly when the zoom in the browser is 100% but I have issues when the screen resolution is changed or if the zoom in the browser is changed.
I tried several updates (margin, canvas, ...)but I don't find really a solution for that.
Could you please help me with that ?
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: