feat: n8n initial commit — JavaScript (Node.js) n8n workflow automation + axios/cheerio/puppeteer/xlsx
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
const path = require('path');
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({ headless: true });
|
||||
const page = await browser.newPage();
|
||||
|
||||
const htmlPath = path.resolve(__dirname, 'Prisa_Yachts_Brochure.html');
|
||||
await page.goto(`file:///${htmlPath.replace(/\\/g, '/')}`, { waitUntil: 'networkidle0' });
|
||||
|
||||
await page.pdf({
|
||||
path: path.resolve(__dirname, 'Prisa_Yachts_Brochure.pdf'),
|
||||
format: 'Letter',
|
||||
margin: { top: 0, right: 0, bottom: 0, left: 0 },
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true,
|
||||
});
|
||||
|
||||
await browser.close();
|
||||
console.log('PDF generated: Prisa_Yachts_Brochure.pdf');
|
||||
})();
|
||||
Reference in New Issue
Block a user