Sha256: 4e24e91e1c651301b0bc1be7ad7137b61ed4ef42347ae2a53a9b2cae4154b8fd

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

#!/usr/bin/env node
'use strict';

const puppeteer = require('puppeteer');

const createPdf = async() => {
  let browser;
  let exitCode = 0;
  try {
    browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
    const page = await browser.newPage();
    await page.goto(process.argv[2], {waitUntil: 'networkidle2'});
    await page.pdf({
      path: process.argv[3],
      format: 'A4'
    });
  } catch (err) {
      console.error(err.message);
      exitCode = 1
  } finally {
    if (browser) {
      browser.close();
    }
    process.exit(exitCode);
  }
};
createPdf();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metanorma-0.3.13 bin/metanorma-pdf.js