Created
June 20, 2018 14:11
-
-
Save szakharchenko/60b905c7a77bb600ace3c6e9efdf126e to your computer and use it in GitHub Desktop.
Trivial PhantomJS renderer sample
This file contains hidden or 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(); | |
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