mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
13 lines
316 B
JavaScript
13 lines
316 B
JavaScript
const puppeteer = require('puppeteer');
|
|
|
|
module.exports = async function (html, filepath) {
|
|
const browser = await puppeteer.launch();
|
|
const page = await browser.newPage();
|
|
await page.setContent(html);
|
|
await page.pdf({
|
|
path: filepath,
|
|
format: 'A4'
|
|
});
|
|
await browser.close();
|
|
}
|