-
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
With too big margin x, y coordinates passed to text() func. downloaded PDF seems to be empty #1220
Comments
Hi @alundiak, you've used |
First of all, I decreased value of numbers in The initial code suggested by
I've became the "first-time-consumer" of this library today, so I did simple copy of that code, assuming, that code is correct, and should show me how the magic happens. If so, that I would suggest @MrRio review default code example/suggestion and change in readme file, so that people don't face with this issue. Strange, how none faced with this yet and did not reported here?! Either none use this lib yet (except @eKoopmans), or issue appears only in my case. PS. Maybe there is some kind of sense, to provide additional check for inches value of margins. But I realize it depends on screen resolution, so it's tough, and better to give responsibility to end consumers, like in my example :) |
You're right, the readme has that mistake in it. The first example uses I'll make a pull request to update the readme, unless you'd rather make one yourself! |
I use jsPDF
v1.3.4
.Here is my HTML:
JS:
or https://jsfiddle.net/landike/n55326zk/
What I saw
Empty PDF file - file with white page, but landscaped. I opened file with Chrome PDF viewer and
Acrobat Reader
.What I expected
Landscaped PDF file with text "Hello world!".
I tested/verified on MacOS, on browsers: Chrome 58, Chrome Canary v60, Firefox 53, Safari 10.1.
When I comment lines
downloaded PDF file contains "Hello world!".
So I may assume, that
unit
/format
parsing is somehow wrong. Maybe for MacOS.The text was updated successfully, but these errors were encountered: