~/utility/web-printer
Universal Web Printer — URL & HTML to PDF, Image
Convert any URL or HTML to PDF, PNG, JPEG, or WebP with smart scroll-stitch, element extraction, PDF encryption, and watermarking.
media
>99% success
TypeScriptPlaywrightPDF-libSharp
Global
categoryutility / media
languageTypeScript
stackTypeScript, Playwright, PDF-lib, Sharp
marketsGlobal
success>99%
outputclean, RAG-ready JSON
key features
Multi-format output — PDF, PNG, JPEG, WebP
Multiple view modes — viewport, full-page, CSS selector, readability
Smart scroll-stitch for accurate full-page captures
Element-level extraction via CSS selectors
Page manipulation — remove elements, click buttons, inject CSS, hide fixed headers
PDF encryption (RC4 128-bit) and watermarking
PDF merging for multi-page documents
Custom viewport and scale factor configuration
use cases
- Automated report generation from web dashboards
- Website archival and documentation
- Visual regression testing snapshots
- E-commerce product page screenshots for catalogs
- Legal compliance — capturing web content as evidence
- Generating PDFs from web applications
input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
startUrls | array | optional | URLs to render |
htmlContent | string | optional | Raw HTML to render |
outputFormat | string | optional | pdf, png, jpeg, or webp (default: pdf) |
viewMode | string | optional | viewport, fullPage, selector, or readability |
targetSelector | string | optional | CSS selector for element-level capture |
viewportWidth | number | optional | Browser viewport width (default: 1280) |
viewportHeight | number | optional | Browser viewport height (default: 720) |
removeSelectors | array | optional | CSS selectors of elements to remove before capture |
pdfPassword | string | optional | Encrypt PDF with RC4 128-bit encryption |
Output Example
The tool generates files in your chosen format (PDF, PNG, JPEG, or WebP) and stores them in the Apify dataset. Each output includes metadata:
1{
2 "url": "https://example.com",
3 "format": "pdf",
4 "fileName": "example-com.pdf",
5 "fileSize": 245832,
6 "viewMode": "fullPage",
7 "viewport": { "width": 1280, "height": 720 },
8 "encrypted": false
9}
faq
Can I capture just a specific element on the page?
Yes, use the targetSelector parameter with a CSS selector to capture only a specific element. For example, use '#main-content' to capture just the main content area.
How does smart scroll-stitch work?
For full-page captures, the tool scrolls the page in increments, capturing each viewport slice, then stitches them together. This ensures lazy-loaded content and animations are properly captured.
Can I remove cookie banners or ads before capture?
Yes, use removeSelectors to specify CSS selectors of elements to remove. You can also use hideFixedElements to hide sticky headers and floating elements.
related in ~/utility
testing
Global API Load Tester — 10K+ RPS Stress Test
Simulate 10K+ RPS with geo-distributed load testing.
open