// Requires html-pdf-chrome, const htmlPdf = require('html-pdf-chrome'); const options = { port: 9222, // port Chrome is listening on printOptions: { printBackground: true, paperWidth: 8.267717, paperHeight: 11.69291, marginTop: 1, marginRight: 2, marginBottom: 1, marginLeft: 1 }, }; const url = 'http://192.168.73.188:9001/p/Ransom-Headlessnesss-in-the-Design/export/html'; htmlPdf.create(url, options).then((pdf) => pdf.toFile('test.pdf')); process.exit();