1 var page = require('webpage').create(),
2 system = require('system');
4 var url = system.args[1] || 'http://www.indexdata.com/';
5 var file_png = system.args[2] || 'indexdata.png';
7 if (system.args.length === 1) {
8 console.log('Usage: screenshot.js <some URL> <file.png>');
12 // page.zoomFactor = 1.0;
14 width: system.args[3] ? system.args[3] : 1200,
15 height: system.args[4] ? system.args[4] : 1000
19 width: page.viewportSize.width,
20 height: page.viewportSize.height
23 page.open(url, function () {
25 setTimeout(function () {
26 var ret = page.render(file_png);