~/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 TypeScriptPlaywrightPDF-libSharp Global
proooxy/web-printer — spec
categoryutility / media
languageTypeScript
stackTypeScript, Playwright, PDF-lib, Sharp
marketsGlobal
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
sourceTypestringoptionalurl (default) or html — render startUrls or htmlContent
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)
scaleFactornumberoptionalDevice scale factor for sharper screenshots (default: 2)
removeSelectorsarrayoptionalCSS selectors of elements to remove before capture
clickSelectorsarrayoptionalCSS selectors to click before capture, e.g. Load More buttons
hideFixedElementsbooleanoptionalHide fixed/sticky elements such as navbars during capture (default: true)
customCssstringoptionalCustom CSS injected before rendering
pdfPasswordstringoptionalEncrypt PDF with RC4 128-bit encryption
mergePdfsbooleanoptionalMerge all generated PDFs into a single file
watermarkobjectoptionalText or image watermark added to output files

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  "sourceType": "url",
 4  "outputFormat": "pdf",
 5  "viewMode": "full-page",
 6  "fileName": "example_com_2025-12-11T16-06-29-849Z.pdf",
 7  "fileUrl": "https://api.apify.com/v2/key-value-stores/abc123DEF456ghi78/records/example_com_2025-12-11T16-06-29-849Z.pdf",
 8  "fileSize": 41613,
 9  "pageCount": 1,
10  "capturedAt": "2025-12-11T16:06:29.852Z"
11}

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