Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use puppeteer for generating the PDF's? #12

Open
cbleslie opened this issue Jan 20, 2018 · 5 comments
Open

Use puppeteer for generating the PDF's? #12

cbleslie opened this issue Jan 20, 2018 · 5 comments

Comments

@cbleslie
Copy link
Contributor

cbleslie commented Jan 20, 2018

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

@galaxyblack
Copy link

Yeah, there are tons of other open source options, you don't need to be uising prince.

@thomaspark
Copy link
Owner

Setting up a way to build with a more open option like Puppeteer would be welcome.

@cbleslie
Copy link
Contributor Author

#13

PR for this issue. ;)

@7fe
Copy link

7fe commented Aug 9, 2018

@cbleslie if you look at the outputs of Chrome they do not match prince

@cbleslie
Copy link
Contributor Author

@limeb Totally not perfect. I would love help with the issues, feel free to raise a PR if you have the time to look into rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants