Javascript

Javascript example

Install wepdf module

$ npm install wepdf
const wepdf = require('wepdf')('your_api_key');
const fs = require('fs');
// Step 3 : execute
let yourOptions = {
pdf: {
landscape: true,
},
};
return wepdf.prepare(yourOptions).render('https://en.wikipedia.org/wiki/PDF').then(res => {
try {
fs.writeFileSync('wepdf.pdf', res.body);
} catch (err) {
throw (err)
}
});