1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-07-05 01:20:06 +01:00

Wrap rasterize.js in IIFE / satisfy jsHint.

This commit is contained in:
hacksalot 2016-01-07 18:33:26 -05:00
parent 97ebecd84a
commit 840d17c67b

View File

@ -1,17 +1,20 @@
// Exemplar script for generating documents with Phantom.js. // Exemplar script for generating documents with Phantom.js.
// https://raw.githubusercontent.com/ariya/phantomjs/master/examples/rasterize.js // https://raw.githubusercontent.com/ariya/phantomjs/master/examples/rasterize.js
"use strict";
var page = require('webpage').create(), (function() {
"use strict";
var page = require('webpage').create(),
system = require('system'), system = require('system'),
address, output, size; address, output, size;
if (system.args.length < 3 || system.args.length > 5) { if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px'); console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px');
console.log(' "800px*600px" window, clipped to 800x600'); console.log(' "800px*600px" window, clipped to 800x600');
phantom.exit(1); phantom.exit(1);
} else { } else {
address = system.args[1]; address = system.args[1];
output = system.args[2]; output = system.args[2];
page.viewportSize = { width: 600, height: 600 }; page.viewportSize = { width: 600, height: 600 };
@ -48,4 +51,6 @@ if (system.args.length < 3 || system.args.length > 5) {
}, 200); }, 200);
} }
}); });
} }
}());