Sha256: f3cd64dcbeade997622ba4d98bd77baf91711b8547f5e8e62c1f3d87215ca7a1
Contents?: true
Size: 881 Bytes
Versions: 1
Compression:
Stored size: 881 Bytes
Contents
'use strict'; const dhalang = require('./dhalang'); const createPdf = async () => { const configuration = dhalang.getConfiguration(false); let browser; try { browser = await dhalang.launchPuppeteer(configuration.puppeteerPath); const page = await browser.newPage(); await page.goto(configuration.webPageUrl, dhalang.getNavigationParameters()); await page.waitFor(250); await page.pdf({ path: configuration.tempFilePath, format: 'A4', margin: { top: 36, right: 36, bottom: 20, left: 36 }, printBackground: true }); } catch (error) { console.log(error.message); } finally { if (browser) { browser.close(); } process.exit(); } }; createPdf();
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
Dhalang-0.3.1 | lib/js/pdf-generator.js |