Convert a URL to a JPG or PDF (Screenshots)#

With Node.js#

Install Node.js client lib#

$ npm install prerendercloud --save

source code: https://github.com/sanfrancesco/prerendercloud-nodejs#screenshots

URL to JPG#

const prerendercloud = require('prerendercloud');
// prerendercloud.set('prerenderToken', 'mySecretToken')
prerendercloud
  .screenshot("http://example.com")
  .then(jpgBuffer => fs.writeFileSync("out.jpg", jpgBuffer));

URL to PDF#

const prerendercloud = require('prerendercloud');
// prerendercloud.set('prerenderToken', 'mySecretToken')
prerendercloud
  .pdf("http://example.com")
  .then(pdfBuffer => fs.writeFileSync("out.pdf", pdfBuffer));

With cURL#

URL to JPG#

curl --compressed http://service.prerender.cloud/screenshot/https://google.com/ > out.jpg

URL to PDF#

curl --compressed http://service.prerender.cloud/pdf/https://google.com/ > out.pdf
Hosted on Roast.io