Rendering demos¶
Five tasks for capturing pages as PDF, PNG, MHTML, and emulated device views.
pdf¶
Render a page to PDF via Chrome's print engine.
curl -s -X POST localhost:8765/tasks/rendering/pdf -d '{}'
curl -s -X POST localhost:8765/tasks/rendering/pdf \
-d '{"url":"https://news.ycombinator.com","path":"/tmp/hn.pdf"}'
Returns both a server-side file at path and base64 in data.doc.
Concepts: pdf action, printBackground, dual output (path + as).
snapshot¶
MHTML snapshot — single-file archive of the page with resources inlined.
Concepts: snapshot action, archival capture, offline viewing.
fullpage-shot¶
Full-page screenshot (entire scrollable document, not just viewport).
Compare with Basics → screenshot (viewport only).
Concepts: screenshot with full-page mode, large PNG output.
html-to-pdf¶
Render arbitrary HTML string to PDF without navigating to a URL.
Concepts: html-to-pdf, generating reports from templates server-side.
emulate-dark¶
Emulate dark-mode / device preferences before capture.
Concepts: device emulation, prefers-color-scheme, pre-capture setup.
Capture comparison¶
| Action | Output | Best for |
|---|---|---|
screenshot |
PNG (base64) | Quick visual check |
pdf |
PDF file | Reports, printing |
snapshot |
MHTML | Archival, legal hold |
html-to-pdf |
PDF from string | Generated documents |
Full params: Actions → rendering
What's next?¶
- Recording — animated GIF instead of static capture
- Network → capture — HAR alongside rendering