mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 11:55:22 +02:00
feat: add weekly sales tab with WoW growth
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
const path = require('path');
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({ headless: 'new' });
|
||||
const page = await browser.newPage();
|
||||
|
||||
// Set viewport for presentation
|
||||
await page.setViewport({ width: 1280, height: 720 });
|
||||
|
||||
// Load the HTML file
|
||||
const filePath = path.join(__dirname, 'presentacion.html');
|
||||
await page.goto(`file://${filePath}`, { waitUntil: 'networkidle0' });
|
||||
|
||||
// Wait for images to load
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Generate PDF
|
||||
await page.pdf({
|
||||
path: path.join(__dirname, 'CrazeAnalytix_Presentation.pdf'),
|
||||
format: 'A4',
|
||||
landscape: true,
|
||||
printBackground: true,
|
||||
margin: { top: '0', right: '0', bottom: '0', left: '0' }
|
||||
});
|
||||
|
||||
console.log('PDF generated successfully!');
|
||||
await browser.close();
|
||||
})();
|
||||
Reference in New Issue
Block a user