Skip to content

Instantly share code, notes, and snippets.

@TranquilMarmot
Created January 15, 2020 08:10
Show Gist options
  • Save TranquilMarmot/685a506056b4ba7340e0591ec9369573 to your computer and use it in GitHub Desktop.
Save TranquilMarmot/685a506056b4ba7340e0591ec9369573 to your computer and use it in GitHub Desktop.
Puppeteer print
import puppeteer from "puppeteer";
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("http://localhost:3000/resume", {
waitUntil: "networkidle2"
});
await page.pdf({
path: "resume.pdf",
format: "Letter",
printBackground: true
});
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment