Created
July 19, 2022 13:24
-
-
Save ajaykarthikr/a497585a9b4468f5fa0cf5c53b20151f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 templateHeader = fs.readFileSync('header.html','utf-8'); | |
const templateFooter = fs.readFileSync('footer.html','utf-8'); | |
const data = await page.pdf({ | |
displayHeaderFooter: true, | |
headerTemplate: templateHeader, | |
footerTemplate: templateFooter, | |
margin: { | |
top: '16px', | |
bottom: '36px', | |
}, | |
printBackground: true, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment