public
Last active

Simple script to render a page using PhantomJS to a .png (with viewport width and timeout).

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8
var page = require('webpage').create();
page.viewportSize = { width: 1200, height: 1200 };
page.open('https://dl.dropbox.com/u/8554242/gitstatus.html?shurcooL', function () {
window.setTimeout(function () {
page.render('out.png');
phantom.exit();
}, 5000);
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.