Screenshot & PDF Renderer: Full Page, Mobile & Dark Mode avatar

Screenshot & PDF Renderer: Full Page, Mobile & Dark Mode

Pricing

$5.00 / 1,000 successful captures

Go to Apify Store
Screenshot & PDF Renderer: Full Page, Mobile & Dark Mode

Screenshot & PDF Renderer: Full Page, Mobile & Dark Mode

Capture URLs as PNG, JPEG, WebP or PDF with Chromium. Choose full-page or element captures, desktop/mobile/tablet sizes, dark mode, ad blocking and cookie-banner hiding. Export stored files and structured results; failed captures are not charged.

Pricing

$5.00 / 1,000 successful captures

Rating

0.0

(0)

Developer

Paul Vasquez

Paul Vasquez

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

17 hours ago

Last modified

Categories

Share

Screenshot / PDF Renderer

What it does

This Python Apify Actor opens URLs in headless Chromium and saves PNG, JPEG, WebP, or PDF captures. Each successful URL produces a binary record in the default key-value store and one dataset row linking to it. Failed navigations produce error rows without a capture charge. One browser serves a bounded pool of workers; each capture gets its own context, keeping cookies and page state separate.

Use it for visual monitoring, responsive-layout checks, page archives, report attachments, or previews. It renders JavaScript, but does not log into websites, solve challenges, scroll through infinite feeds, or guarantee that a page has finished every asynchronous update.

Input

urls is required: one to 1,000 absolute HTTP(S) URLs. Data URLs are also accepted for local fixtures. Strings are trimmed, while paths, queries, fragments, and duplicate entries are preserved. URL userinfo is rejected. Every duplicate is processed separately; identical URL/format pairs overwrite the same store record.

format defaults to png; alternatives are jpeg, webp, and pdf. fullPage defaults to true for images. PNG is lossless; JPEG and WebP accept quality from 0–100, default 80. WebP is encoded from Chromium's PNG output with Pillow. Quality does not affect PNG or PDF.

device selects desktop (1440×900, scale 1), mobile (390×844, scale 3), or tablet (820×1180, scale 2). Optional width and height override viewport dimensions independently; deviceScaleFactor overrides scale. Mobile/tablet enable touch, mobile layout, and an Android Chromium user agent. These are generic presets, not physical-device fidelity guarantees.

darkMode, blockAds, and hideCookieBanners default to false. Dark mode requests the browser's dark color scheme. Ad blocking matches exact hosts and subdomains in the original bundled src/ad_hosts.txt list. It never matches a hostname merely because the blocked name appears in a path or query. Service workers are disabled. Consent hiding injects targeted CSS for common banners; it does not submit consent, change cookies, remove every overlay, or unlock page scrolling.

waitUntil accepts load (default), domcontentloaded, or networkidle. delayMs adds 0–10,000 milliseconds afterward. timeoutSecs, default 45 and maximum 180, bounds the whole capture; cleanup can add five seconds. Persistent network traffic can make network-idle waits time out. maxConcurrency defaults to five and accepts 1–20.

selector captures the first matching visible element, overriding full-page image capture. For PDF, its subtree is isolated in place and printed with pagination; this is not a pixel-identical rectangular PDF crop. Missing or hidden targets time out.

pdfOptions accepts paperFormat (A4 default; A0–A6, Letter, Legal, Tabloid, Ledger), landscape, printBackground (true default), and a margin object with top/right/bottom/left values. Margins accept numbers in pixels or strings with px, in, cm, or mm units. PDFs use Chromium's print styles. fullPage and device scale do not control PDF pagination.

proxyConfiguration uses Apify's proxy editor schema, including useApifyProxy, proxy groups/country, or proxyUrls. Omitted configuration makes direct connections. Proxy URLs are assigned per capture and authentication is separated from the server address.

Run locally

Use Python 3.12 from this directory:

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
$env:PLAYWRIGHT_BROWSERS_PATH = Join-Path $PWD '.browsers'
.\.venv\Scripts\python.exe -m playwright install chromium
$env:APIFY_LOCAL_STORAGE_DIR = Join-Path $PWD 'storage/local'
New-Item -ItemType Directory -Force "$env:APIFY_LOCAL_STORAGE_DIR/key_value_stores/default" | Out-Null
Copy-Item INPUT.json "$env:APIFY_LOCAL_STORAGE_DIR/key_value_stores/default/INPUT.json"
.\.venv\Scripts\python.exe -m src

The Dockerfile uses apify/actor-python-playwright:3.12 and installs Chromium matching the pinned Playwright package. The five-site PNG/PDF reproduction script is validation/run_live.ps1. See VALIDATION.md for environment limitations and measured outcomes.

Output and pricing

Rows contain url, finalUrl, status (success or error), format, width, height, fileSizeBytes, keyValueStoreKey, imageUrl, title, capturedAt, and error. Image dimensions are actual output pixels. PDF dimensions describe its first page at 96 CSS pixels per inch. Error rows have no file link, zero bytes, and a concise error. HTTP errors and invalid TLS certificates fail without disabling certificate verification.

Keys combine a safe hostname label, URL/format hash, and extension. On Apify, links use the configured default store ID; SDK 4 names the configuration property Actor.configuration. Locally they are absolute file paths. A public URL's accessibility still depends on platform storage permissions and retention.

The price is $0.005 per successful capture. Actor.charge runs once after file storage and dataset emission. Configure the single custom capture event in Console before publication; the declaration alone does not activate billing. Local ignored-charge warnings are expected. Storage, dataset writes, and billing are not transactional across crashes; automatic retries are deliberately absent.

Tests and limitations

Run .\.venv\Scripts\python.exe -m unittest discover -s tests -v after installing Chromium. Offline tests cover validation, presets, keys, consent CSS, host matching, error isolation, concurrency, storage links, and charging. The integration test uses a tiny local HTTP server and checks image/PDF content, element capture, HTTP failure, and timeout handling. Browser startup, storage infrastructure, or billing-service failures can fail the run. Large pages can exhaust memory; lower concurrency for demanding sites. No push or publication is part of this project task.

Example output

One real dataset row from validation/results.json, trimmed by omitting fields without changing retained values:

{
"url": "https://example.com",
"finalUrl": "https://example.com/",
"status": "success",
"format": "png",
"width": 1440,
"height": 900,
"fileSizeBytes": 12088,
"keyValueStoreKey": "example-com-4f5b6f48f2bb03938b39e49781748adb.png",
"title": "Example Domain",
"capturedAt": "2026-09-26T06:50:42.674919+00:00",
"error": null
}

The local file path is omitted; the retained key identifies the saved PNG. This is one of the five successful PNG captures recorded in VALIDATION.md, which separately records five PDF captures. Dimensions and byte size describe this observation only.

Use cases

  • QA teams can capture release-candidate pages at desktop and mobile viewport settings for manual comparison.
  • Digital agencies can attach client landing-page screenshots to recurring review reports.
  • Research teams can archive public report pages as PDFs for a dated project record.
  • Content operations teams can generate page previews for an internal editorial inventory.

Pricing example: 1,000 successful captures x $0.005 per capture event = $5.00 in event fees. Failed URLs cost nothing. Local runs do not bill.

Platform compute is included in that price; there is no separate usage charge.