-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Issue 17: Make paper size for the PDF export specifiable #15
Conversation
http://code.google.com/p/phantomjs/issues/detail?id=17 Adding a new phantom property called "paperSize". It takes one of the two possible dictionary variants: { width: '200px', height: '300px', border: '0px' } { format: 'A4', orientation: 'portrait', border: '1cm' } - If no paperSize is defined, the size is defined by the web page - supported dimension units are: mm, cm, in, px. No unit means px. - border is optional and defaults to 0. - supported formats are: A3, A4, A5, Legal, Letter, Tabloid - orientation (portrait|landscape) is optional and defaults to portrait I'm considering implementing a short form like: phantom.paperSize = 'A4'; ...needs further investigation.
I think "If no paperSize is defined, the size is defined by the web page" is a behavior change to version 1.0? If yes, I'll add some note in the ChangeLog. |
Yes, that's a change of default behaviour. I was hesitating changing the default. But the "driver-dependent" fact and inconsistency with the other graphics formats seemed a good argument for it. If requested, I'm willing to change the default back to 1.0 behavior, the change is trivial. |
Ariya, something went wrong with the Pull request. I was hoping to get |
Ah, not true what I sais. I was just fooled by a merge commit. |
This can be useful for issue #15.
http://code.google.com/p/phantomjs/issues/detail?id=17
Adding a new phantom property called "paperSize". It takes one of the two possible dictionary variants:
{ width: '200px', height: '300px', border: '0px' }
{ format: 'A4', orientation: 'portrait', border: '1cm' }
I'm considering implementing a short form like:
phantom.paperSize = 'A4';
...needs further investigation.