Created
July 17, 2013 17:06
-
-
Save gabrielflorit/6022462 to your computer and use it in GitHub Desktop.
rasterize 1920x1200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(), | |
system = require('system'), | |
address, output, size; | |
var width = 1920; | |
var height = 1200; | |
address = system.args[1]; | |
output = system.args[2]; | |
page.viewportSize = { width: width, height: height }; | |
page.clipRect = { width: width, height: height }; | |
page.open(address, function (status) { | |
if (status !== 'success') { | |
console.log('Unable to load the address!'); | |
phantom.exit(); | |
} else { | |
page.evaluate(function() { | |
document.body.bgColor = 'white'; | |
}); | |
window.setTimeout(function () { | |
page.render(output); | |
phantom.exit(); | |
}, 200); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment