Skip to content

Instantly share code, notes, and snippets.

@ChristianGaertner
Created August 14, 2013 20:17
Show Gist options
  • Select an option

  • Save ChristianGaertner/6235154 to your computer and use it in GitHub Desktop.

Select an option

Save ChristianGaertner/6235154 to your computer and use it in GitHub Desktop.
[IDEA] PhantomJS Dynamic HTML render-engine
var page = require(‘webpage’).create();
page.viewportSize ={ width: 200, height : 200 };
page.content = “GoogleChart goes here”; //maybe load a skeleton here and replace some data.
page.setContent(page.content,page);
window.setTimeout(function () {
page.render(‘newimage.png’);
phantom.exit();
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment