Page sizing
Closed this issue · 2 comments
The jsPDF settings are for a A4 page in portrait orientation.
The constants for the page size are a4Height: 595.28, a4Width: 841.89. I believe these are reversed.
A portrait page should have a width smaller than its height. I was having trouble getting content to not break across pages and reversing these constants fixed the issue.
It is also unclear from the documentation what the overrideWidth option does and what unit it is in.
overrideWidth
will set the width of the screenshot it will take. By default I think the width is taken from users display width.
This parameter is handy in case you want to make a pdf from a popup and it's width will be less than the displays width. You can pass overrideWidth = element.ScrollWidth
in options (where filename is set).
This way, the resulting image will have the same width you see on your monitor.
@jwalduck thanks for the feedback. The issue with reversed constants appeared in 0.2.1
and was fixed in 0.2.4
09e76c3.
Thank you @Tasin5541 for elaborating on the overrideWidth
option.