Created
March 10, 2021 18:28
-
-
Save mayank/d934254f164d47d1908438c734068a6d 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
const options = { | |
ignorePDF: <boolean>, | |
generateJPG: <boolean>, | |
jpgQuality: <numeric>, | |
chrome: <puppeteer-chrome-opts>, | |
}; | |
// returns a buffer consists of pdf, html and jpeg as requested | |
const pdfBuffer = await mould.pdf('via', { | |
company_report_details: { | |
name: "Roadzen", | |
email: "support@roadzen.io", | |
phone: "23874983589234" | |
} | |
}, options); | |
const html = pdfBuffer.getHtml(); | |
const pdf = pdfBuffer.getPdf(); | |
const jpeg = pdfBuffer.getJPG(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment