~/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
proooxy/web-printer — spec
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

ParameterTypeRequiredDescription
startUrlsarrayoptionalURLs to render
htmlContentstringoptionalRaw HTML to render
outputFormatstringoptionalpdf, png, jpeg, or webp (default: pdf)
viewModestringoptionalviewport, fullPage, selector, or readability
targetSelectorstringoptionalCSS selector for element-level capture
viewportWidthnumberoptionalBrowser viewport width (default: 1280)
viewportHeightnumberoptionalBrowser viewport height (default: 720)
removeSelectorsarrayoptionalCSS selectors of elements to remove before capture
pdfPasswordstringoptionalEncrypt 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

Run Universal Web Printer — URL & HTML to PDF, Image, or get a custom build

Start extracting on Apify in minutes, or hire me to build a bespoke scraper and RAG pipeline for your exact source and schema.

run on Apify get custom data