Created
January 15, 2020 08:10
-
-
Save TranquilMarmot/685a506056b4ba7340e0591ec9369573 to your computer and use it in GitHub Desktop.
Puppeteer print
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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