Last active
September 28, 2017 20:17
-
-
Save jotto/95a7895bc3ed0a7c24ec5385447b4226 to your computer and use it in GitHub Desktop.
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
// npm install prerendercloud | |
require('prerendercloud') | |
.screenshot("https://google.com") | |
.then(jpgBuffer => fs.writeFileSync("out.jpg", jpgBuffer)); | |
require('prerendercloud') | |
.pdf("https://google.com") | |
.then(pdfBuffer => fs.writeFileSync("out.pdf", pdfBuffer)); |
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
curl https://service.prerender.cloud/screenshot/https://google.com/ > out.jpg | |
curl https://service.prerender.cloud/pdf/https://google.com/ > out.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
convert URLs to JPGs or convert URLs to PDFs