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