Skip to content

Use puppeteer for generating the PDF's? #12

@cbleslie

Description

@cbleslie

I figure we could make a gulp build, and run puppeteer (headless chrome) to export the PDF's? Thoughts?

https://github.com/GoogleChrome/puppeteer has an example of creating a PDF from a page:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
  await page.pdf({path: 'hn.pdf', format: 'A4'});

  await browser.close();
})();

Addtional docs: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions