first commit

This commit is contained in:
Peter Hedenskog 2012-07-04 21:51:03 +02:00
parent 06d2172a64
commit 02f518f678
1 changed files with 21 additions and 0 deletions

21
dependencies/rasterize.js vendored Normal file
View File

@ -0,0 +1,21 @@
var page = require('webpage').create(),
address, output, size;
if (phantom.args.length < 2 || phantom.args.length > 3) {
console.log('Usage: rasterize.js URL filename');
phantom.exit();
} else {
address = phantom.args[0];
output = phantom.args[1];
page.viewportSize = { width: 600, height: 600 };
page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
} else {
window.setTimeout(function () {
page.render(output);
phantom.exit();
}, 200);
}
});
}