This adds a new WebPage::zoomFactor property, which can be used to
zoom the page, i.e.:
page.zoomFactor = 1.5; // zoom by 50% in
page.zoomFactor = 0.5; // zoom by 50% out
The rasterize.js example is adapted to take an optional fourth argument
to set the zoom factor. Furthermore, the webpage-spec is extended with
a simple test case for the new property.
ISSUE: 579 (http://code.google.com/p/phantomjs/issues/detail?id=579)
After the change to system.args which has the app as first element,
the rasterize example was not properly adapted. Due to that, one
could not pass a size parameter to it anymore, resulting in PDFs
without page breaks.
ISSUE: 523 (http://code.google.com/p/phantomjs/issues/detail?id=523)
Now the left/top/right/bottom print margins can be set separately
using the pageSize.margin property. You can either use
pageSize.margin = "10px"
or use a map to set the margins separately:
pageSize.margin = {
left: "10px",
top: "5cm",
right: "7in",
bottom: "13mm"
};
pageSize.border is now a synonym for pageSize.margin to keep
compatibility to existing scripts.
ISSUE: 388 (http://code.google.com/p/phantomjs/issues/detail?id=388)
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.