1 var page = require('webpage').create(),
2 system = require('system');
4 if (system.args.length < 7) {
5 console.log('Usage: printmargins.js URL filename LEFT TOP RIGHT BOTTOM');
6 console.log(' margin examples: "1cm", "10px", "7mm", "5in"');
9 var address = system.args[1];
10 var output = system.args[2];
11 var marginLeft = system.args[3];
12 var marginTop = system.args[4];
13 var marginRight = system.args[5];
14 var marginBottom = system.args[6];
15 page.viewportSize = { width: 600, height: 600 };
25 page.open(address, function (status) {
26 if (status !== 'success') {
27 console.log('Unable to load the address!');
29 window.setTimeout(function () {