Sha256: 651d51d7e1eecc361dd04689f6fdd4cbbfaaa6d6b7af7fa6d919cf8ec0a31693

Contents?: true

Size: 840 Bytes

Versions: 1

Compression:

Stored size: 840 Bytes

Contents

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

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

    let browser;
    try {
        browser = await dhalang.launchPuppeteer(configuration.puppeteerPath);
        const page = await browser.newPage();
        await dhalang.configurePage(page, configuration.userOptions);
        await page.goto(configuration.webPageUrl, configuration.userOptions.navigationParameters);
        await page.waitForTimeout(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.4.0 lib/js/screenshot-generator.js