Script for having both PhantomJS & SlimerJS Screenshots in a responsive way.
$ npm install async --save-dev
Edit screenshots.coffee you match your async.js absolte path
Please See [Note][Note]
Edit settings.json as needed:
{ "url2render": "http://n32.es", "type": ".pdf", "papersize": "A4", "viewport": [[320, 480], [480, 320], [960, 640], [640, 960], [1136, 960], [960, 1136], [1440, 900], [1920, 1080], [2048, 1536], [1536, 2048]] }
- url2render: Screenshot this page.
- format: '.png' or '.pdf'
- papersize: only applicable when format is pdf. Admited values:
- Simple Values: 'A4', 'B6'
- Dimensions: '21cmx21cm', '4000ptx6000pt'
- viewport: Array containing viewport sets: [width, height]
** Both PhantomJS (Webkit) and SlimerJS (Firefox) screenshots **
$ casperjs screenshots.coffee settings.json && casperjs --engine=slimerjs screenshots.coffee settings.json
** PhantomJS (Webkit) screenshots **
$ casperjs screenshots.coffee settings.json
** SlimerJS (Firefox) screenshots **
$ casperjs --engine=slimerjs screenshots.coffee settings.json
[Note]: There seems to be a bug in slimerJS, no relative require calls to "async" where possible. Absolute paths must be added using. Son this exception is been considered.
require.paths.push()
(node, npm, phantom, slimer and casper crew!)