Closed jtrip closed 3 years ago
it's an upstream limitation: https://playwright.dev/#version=v1.6.1&path=docs%2Fapi.md&q=pagepdfoptions
NOTE Generating a pdf is currently only supported in Chromium headless.
You can use xvfb-run to run your browsers headful to make screenshots in Docker etc. Example:
xvfb-run node foo.js
an inside foo.js you start Chromium headless: false
Thanks for the reference and tip! I'll go ahead and close this for now then. 😄
@mxschmitt Has PrintToPdf been implemented now?
Its still a Chromium only feature: https://playwright.dev/docs/api/class-page#page-pdf
Hello, just getting started with playwright-python. I am running Python 3.7.7 on macOS Mojave (10.14.6) I created a venv, activated it, and ran
pip install playwright
andpython -m playwright install
.Using a simple load page and create pdf script, works great.
However running the same with:
browser = p.chromium.launch(headless=False)
results in an exception
So it appears PrintToPDF is implemented partially, as it only seems to work when running headless.