-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hey Mixu, it seems like puppeteer would make this a lot simpler.
Something like this works for the same thing, and allows headers and footers. It uses puppeteer which is headless chrome developed by google.
Honestly, it seems superior, and more up to date. I wonder if you should just deprecate this package and recommend this in the readme.
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('file:///C:/dev/wkhtmltesting/page-full.html');
await page.pdf({
path: 'page-full-pupp.pdf',
format: 'A4',
displayHeaderFooter: true,
headerTemplate: '<div></div>',
footerTemplate:
'<div style="font-size: 12px; width: 100%; text-align: center; font-style: italic; padding-bottom: 0.5in; font-family: serif;">'+
'Page <span class="pageNumber"></span>'+
'</div>',
margin: {
top: '0.5in',
bottom: '1.5in',
left: '1in',
right: '1in',
}
});
await browser.close();
})();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels