-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Create custom size PDF #372
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
Try this:
This will create a 5in x 2in PDF. |
@Flamenco Thank you much! Couldn't find that in docs. |
You can even set different sizes for every page you add: var doc = new jsPDF('p', 'mm', [68,20]);
doc.addPage(100, 200); |
Fix for #372, Add Documentation Information
Solved by PR #1590 |
Thank you guys! |
That would be so nice... Any update, when the next version will be available? EDIT: Nevermind, it works! Thanks for the great work! var doc = new jsPDF({ |
I suggest the following patch to enable custom PDF size.
The idea is that the format parameter can take an object with width and height properties.
Example:
In that example, the format would be widthMm x heightMm. The units of the format are the PDF units. Then, my patch creates a new pageFormat with key "custom" and size translated to standard pt units.
Please find the patch below, it only affects a few lines of the original code:
The text was updated successfully, but these errors were encountered: