Commit Graph

16 Commits (2c0316f07dc0729025a62712b467d6b40423d15a)

Author SHA1 Message Date
Petteri Räty a86ae1948c Fix rasterize example exit status on failure.
https://github.com/ariya/phantomjs/issues/11911
2014-08-17 23:23:05 -07:00
Bojan Markovic 54c1611801 Added bitmap size and clipping to rasterize.js
Added support for defining window/viewport size and eventual clipping to bitmap rasterization similar to how it is used with paper output.
2014-01-01 13:14:19 +01:00
Ariya Hidayat 9c0888d54d Fix potential hang in the example scripts due to missing exit() call.
Patch by Jônatas Pedraza <jonatas.nona@gmail.com> and Vivek Galatage
<vivekgalatage@gmail.com>.

http://code.google.com/p/phantomjs/issues/detail?id=922
2012-12-16 23:02:44 -08:00
Milian Wolff 5c2e330a15 Make QWebPage::zoomFactor accessible to PhantomJS scripts.
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)
2012-06-08 11:05:54 +02:00
Brikou CARRE 1125b86e72 Fixed missing exit code when errornous.
http://code.google.com/p/phantomjs/issues/detail?id=544
2012-05-17 23:35:02 -07:00
Milian Wolff bf029ae65a Properly handle fourth CLI parameter in rasterize.js example.
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)
2012-05-02 15:31:46 +02:00
execjosh b73ec44796 Update examples to use system.args.
Also update coffee-script script path names in usage messages.

http://code.google.com/p/phantomjs/issues/detail?id=276
2012-03-15 01:11:30 -07:00
Milian Wolff a638a07339 js-ify, rename and extend print-margins property
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)
2012-02-23 14:25:16 +01:00
Ivan De Marino e0e5535e0e Updated examples to use "require('webpage').create()" instead of "new WebPage()". 2011-09-12 21:17:54 +01:00
Dunk Fordyce 42472aa92f fix page/phantom variable wrongness 2011-06-21 14:34:41 +01:00
Ariya Hidayat f84bef4b38 rasterize.js: Port to WebPage object. 2011-05-25 14:37:58 -07:00
Alessandro Portale fbb524e629 Issue 17: Make paper size for the PDF export specifiable
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.
2011-03-18 10:26:45 +01:00
Ariya Hidayat 7f9e03ffad Change phantom.arguments to phantom.args.
This is explained in
http://code.google.com/p/phantomjs/issues/detail?id=16:

'arguments' is reserved word.

Reported by: Nicolas Ferrero.
2011-01-14 22:24:47 -08:00
Ariya Hidayat 04cc4193ca Change phantom.storage to phantom.state. 2010-12-31 22:09:02 -08:00
Ariya Hidayat 24d433ea13 Remove phantom.log, just use the de-facto console.log for logging. 2010-12-31 20:10:34 -08:00
Ariya Hidayat c5de293368 rasterize.js: Rasterize HTML/XML/SVG document to an image. 2010-12-31 18:27:15 -08:00