easy-html-to-pdf
Upto the date lib for creating pdf files using HTML, internally using updated version of puppeteer for smooth integration.
Install
npm install --save dmarc-solution
How to use
Generate PDF with HTML Content
const pdf = require("easy-html-to-pdf").PDFGenerator;
const options = {
format: "A4",
headerTemplate: "<p></p>",
footerTemplate: "<p></p>",
displayHeaderFooter: false,
margin: {
top: "40px",
bottom: "100px",
right: "0px",
left: "0px",
},
landscape: false,
printBackground: true,
path: "test.pdf",
};
pdf.convertToPdf("<h1>Hello world</h1>", options);