# 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:** 2 total users, 1 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Screenshot & PDF Renderer — Full-Page Web Capture API",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "owFjxoF6QBXysvmPo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nivlekk~screenshot-pdf-renderer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nivlekk-screenshot-pdf-renderer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/nivlekk~screenshot-pdf-renderer/runs": {
            "post": {
                "operationId": "runs-sync-nivlekk-screenshot-pdf-renderer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/nivlekk~screenshot-pdf-renderer/run-sync": {
            "post": {
                "operationId": "run-sync-nivlekk-screenshot-pdf-renderer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "One or more page URLs to capture.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "format": {
                        "title": "Output format",
                        "enum": [
                            "png",
                            "jpeg",
                            "pdf"
                        ],
                        "type": "string",
                        "description": "png / jpeg image, or a pdf document.",
                        "default": "png"
                    },
                    "fullPage": {
                        "title": "Full page",
                        "type": "boolean",
                        "description": "Capture the entire scrollable page (images only; PDF is always full document).",
                        "default": true
                    },
                    "jpegQuality": {
                        "title": "JPEG quality (1-100)",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Only applies to JPEG.",
                        "default": 80
                    },
                    "viewportWidth": {
                        "title": "Viewport width",
                        "minimum": 200,
                        "maximum": 3840,
                        "type": "integer",
                        "description": "Browser width in pixels.",
                        "default": 1280
                    },
                    "viewportHeight": {
                        "title": "Viewport height",
                        "minimum": 200,
                        "maximum": 4320,
                        "type": "integer",
                        "description": "Browser height in pixels (ignored for full-page height).",
                        "default": 800
                    },
                    "deviceScaleFactor": {
                        "title": "Scale factor (retina)",
                        "minimum": 1,
                        "maximum": 3,
                        "type": "integer",
                        "description": "1 = normal, 2 = retina/2x resolution.",
                        "default": 1
                    },
                    "darkMode": {
                        "title": "Dark mode",
                        "type": "boolean",
                        "description": "Render with prefers-color-scheme: dark.",
                        "default": false
                    },
                    "waitUntil": {
                        "title": "Wait until",
                        "enum": [
                            "load",
                            "domcontentloaded",
                            "networkidle"
                        ],
                        "type": "string",
                        "description": "When to consider the page loaded before capturing.",
                        "default": "networkidle"
                    },
                    "delayMs": {
                        "title": "Extra delay (ms)",
                        "minimum": 0,
                        "maximum": 30000,
                        "type": "integer",
                        "description": "Wait this long after load before capturing (for animations/lazy content).",
                        "default": 500
                    },
                    "waitForSelector": {
                        "title": "Wait for selector",
                        "type": "string",
                        "description": "Optional CSS selector to wait for before capturing."
                    },
                    "hideSelectors": {
                        "title": "Hide elements (CSS selectors)",
                        "type": "array",
                        "description": "Remove matching elements before capture — great for cookie banners, ads, chat widgets.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dismissCookieBanners": {
                        "title": "Auto-hide common cookie banners",
                        "type": "boolean",
                        "description": "Hide common cookie/consent overlays automatically.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy (optional)",
                        "type": "object",
                        "description": "Optional — enable if a site blocks the default IP.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
