# Screenshot & PDF Renderer — Full-Page Web Capture API (`nivlekk/screenshot-pdf-renderer`) Actor

Capture full-page screenshots (PNG/JPEG) or PDFs of any URL. Custom viewport, device sizing, dark mode, element hiding, wait conditions — with a direct link to each output.

- **URL**: https://apify.com/nivlekk/screenshot-pdf-renderer.md
- **Developed by:** [Kelvin Yayra Kwaku Ganyo](https://apify.com/nivlekk) (community)
- **Categories:** Automation, Developer tools, Agents
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 screenshot/pdf captureds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Screenshot & PDF Renderer — Full-Page Web Capture API

Turn any URL into a **full-page screenshot** (PNG/JPEG) or a **PDF document** — with the controls the basic tools skip: device sizing, retina, dark mode, wait conditions, and hiding cookie banners so they don't ruin your capture. Every URL comes back as its own structured record with metadata and a link to the saved file in your run storage.

### Why this one

- **Full-page or viewport** — capture the whole scrollable page, not just the fold.
- **PNG, JPEG, or PDF** — one actor for images *and* documents (invoices, reports, archives).
- **Structured, per-URL output** — a dataset row for every capture with format, dimensions, byte size, status, and the file's storage URL (open it from your run in the Console, or fetch via the API with your token).
- **Clean captures** — auto-hide cookie/consent banners, or hide any elements you name (ads, chat widgets).
- **Pixel-perfect control** — viewport width/height, retina scale factor (2×), dark mode, and wait-until / delay / wait-for-selector so lazy content is fully rendered first.
- **Bulk** — pass a whole list of URLs in one run.

### Use cases

- **Visual monitoring** — snapshot pages on a schedule and diff them.
- **Thumbnails & previews** — generate link previews or gallery images.
- **PDF archiving** — save pages or reports as PDF documents.
- **QA & design** — capture pages across viewports and light/dark themes.
- **Feeding LLMs** — give a vision model a clean full-page image of a site.

### Input

| Field | Type | Description |
|---|---|---|
| `urls` | array | Page URLs to capture |
| `format` | string | `png`, `jpeg`, or `pdf` |
| `fullPage` | boolean | Capture the whole page (images) |
| `jpegQuality` | integer | 1–100 (JPEG only) |
| `viewportWidth` / `viewportHeight` | integer | Browser size in px |
| `deviceScaleFactor` | integer | 1 normal, 2 retina |
| `darkMode` | boolean | Render in dark theme |
| `waitUntil` | string | `load` / `domcontentloaded` / `networkidle` |
| `delayMs` | integer | Extra wait before capture |
| `waitForSelector` | string | Wait for a CSS selector first |
| `hideSelectors` | array | CSS selectors to remove before capture |
| `dismissCookieBanners` | boolean | Auto-hide common consent overlays |

```json
{
    "urls": ["https://apify.com"],
    "format": "png",
    "fullPage": true,
    "deviceScaleFactor": 2,
    "dismissCookieBanners": true
}
```

### Output

One dataset item per URL, each with its metadata and the file's storage URL (accessible from your run in the Console, or via the API with your token):

```json
{
    "url": "https://apify.com",
    "format": "png",
    "fullPage": true,
    "status": "ok",
    "fileUrl": "https://api.apify.com/v2/key-value-stores/XXXX/records/capture-1-1721800000000.png",
    "widthPx": 1280,
    "heightPx": 5400,
    "byteSize": 812345,
    "capturedAt": "2026-07-24T00:00:00.000Z"
}
```

### Notes

- PDF output renders the full document (A4, backgrounds on).
- If a site blocks the default IP, enable a proxy in the input.

# Actor input Schema

## `urls` (type: `array`):

One or more page URLs to capture.

## `format` (type: `string`):

png / jpeg image, or a pdf document.

## `fullPage` (type: `boolean`):

Capture the entire scrollable page (images only; PDF is always full document).

## `jpegQuality` (type: `integer`):

Only applies to JPEG.

## `viewportWidth` (type: `integer`):

Browser width in pixels.

## `viewportHeight` (type: `integer`):

Browser height in pixels (ignored for full-page height).

## `deviceScaleFactor` (type: `integer`):

1 = normal, 2 = retina/2x resolution.

## `darkMode` (type: `boolean`):

Render with prefers-color-scheme: dark.

## `waitUntil` (type: `string`):

When to consider the page loaded before capturing.

## `delayMs` (type: `integer`):

Wait this long after load before capturing (for animations/lazy content).

## `waitForSelector` (type: `string`):

Optional CSS selector to wait for before capturing.

## `hideSelectors` (type: `array`):

Remove matching elements before capture — great for cookie banners, ads, chat widgets.

## `dismissCookieBanners` (type: `boolean`):

Hide common cookie/consent overlays automatically.

## `proxyConfiguration` (type: `object`):

Optional — enable if a site blocks the default IP.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://news.ycombinator.com"
  ],
  "format": "png",
  "fullPage": true,
  "jpegQuality": 80,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": 1,
  "darkMode": false,
  "waitUntil": "networkidle",
  "delayMs": 500,
  "dismissCookieBanners": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nivlekk/screenshot-pdf-renderer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("nivlekk/screenshot-pdf-renderer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://apify.com"
  ]
}' |
apify call nivlekk/screenshot-pdf-renderer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nivlekk/screenshot-pdf-renderer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/OBA2wErhQjmddKjEt/builds/owFjxoF6QBXysvmPo/openapi.json
