Sha256: b479ad3dc20c1396f1e16267303cda16ab9df075553b97e1b43a54956cae02b9

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

'use strict';
const dhalang = require('./dhalang')

const createPdf = async () => {
    const configuration = dhalang.getConfiguration(true);

    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.screenshot({
            path: configuration.tempFilePath,
            type: configuration.imageType,
            fullPage: 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/screenshot-generator.js