Skip to content

Instantly share code, notes, and snippets.

@szakharchenko
Created June 20, 2018 14:11
Show Gist options
  • Save szakharchenko/60b905c7a77bb600ace3c6e9efdf126e to your computer and use it in GitHub Desktop.
Save szakharchenko/60b905c7a77bb600ace3c6e9efdf126e to your computer and use it in GitHub Desktop.
Trivial PhantomJS renderer sample
var page = require('webpage').create();
page.open("simple.html", function (status) {
if (status !== "success")
{
console.log("Unable to load");
phantom.exit(1);
}
else
{
page.render("simple.png");
page.render("simple.pdf");
phantom.exit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment