# URL to PDF Converter - Web Page & HTML to PDF API (`rel8ble/url-to-pdf-converter`) Actor

URL to PDF converter: web page URLs in, print-quality PDFs out, one row per URL with a direct PDF link and page count. A4, Letter, Legal, A3, landscape, margins, backgrounds, print CSS or one long page. Cookie banners hidden, bulk lists, failures free. $1.80 / 1,000 PDFs.

- **URL**: https://apify.com/rel8ble/url-to-pdf-converter.md
- **Developed by:** [Giovanni Rich](https://apify.com/rel8ble) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## URL to PDF Converter - Web Page & HTML to PDF API

**URL to PDF converter** and **web page to PDF API** for bulk lists: paste page URLs (one or 50,000) and get a **print-quality PDF of every page**, with a **direct PDF link**, page count, title and HTTP status on one dataset row per URL. **A4, Letter, Legal, A3, A5 or Tabloid**, portrait or **landscape**, margins, backgrounds on or off, the site's **print stylesheet or the screen look**, **header and footer with page numbers**, or **one long page with no page breaks** for archiving.

Built for **archiving web pages, compliance and legal evidence, invoices and reports, offline reading, documentation exports, research and RAG pipelines that ingest PDFs**. Real headless Chromium (Playwright): JavaScript-heavy sites render like in a browser, lazy images are loaded first and cookie banners are hidden.

**$1.80 per 1,000 PDFs + Apify usage**, no start fee. Failed URLs and HTTP 4xx / 5xx pages are **never charged**.

### What you get

- One row per URL: `pdfUrl` (direct link to the file), `pageCount`, `title`, `statusCode`, `finalUrl`, `paperFormat`, `landscape`, `mediaType`, `printBackground`, `marginMm`, `bytes`, `loadTimeMs`, `charged`, `createdAt`.
- The PDF files in the run's key-value store (download from the **Storage** tab or the API).
- A `RUN_SUMMARY` record: saved / charged / failed counts, total pages, failures with reasons, input warnings.

### Sample output

Real rows from the prefilled input (3 URLs, A4 portrait, screen CSS, backgrounds on), Apify cloud run on 3 Dec 2026, **3 PDFs / 21 pages, 23.8 s total run time incl. browser start**:

| url | title | pageCount | bytes | loadTimeMs |
|---|---|---|---|---|
| https://en.wikipedia.org/wiki/Web_scraping | Web scraping - Wikipedia | 12 | 315,195 | 2,896 |
| https://docs.apify.com/academy/web-scraping-for-beginners | Web scraping basics for JavaScript devs | 7 | 2,757,046 | 3,207 |
| https://www.python.org/about/ | About Python™ | 2 | 270,416 | 1,376 |

One row (local test run, 3 Dec 2026):

```json
{
  "url": "https://en.wikipedia.org/wiki/Web_scraping",
  "finalUrl": "https://en.wikipedia.org/wiki/Web_scraping",
  "statusCode": 200,
  "title": "Web scraping - Wikipedia",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/en.wikipedia.org-095e3e295e.pdf",
  "key": "en.wikipedia.org-095e3e295e.pdf",
  "pageCount": 12,
  "paperFormat": "A4",
  "landscape": false,
  "mediaType": "screen",
  "printBackground": true,
  "marginMm": 10,
  "bytes": 164333,
  "loadTimeMs": 4306,
  "charged": true,
  "createdAt": "2026-12-03T17:55:20.776Z"
}
```

### Quick start (3 steps)

1. Paste your URLs into **Page URLs** (bare domains like `example.com` work too).
2. Choose **Paper size**, **Landscape** and **Margin**, or switch on **One long page**.
3. Click **Start**. Open the **PDFs** view and click a link to download.

### How to use

| Goal | Input |
|---|---|
| A4 PDFs of a URL list | `{"urls": ["https://en.wikipedia.org/wiki/PDF"]}` |
| US Letter, landscape, printer-friendly | `{"urls": [...], "paperFormat": "Letter", "landscape": true, "printBackground": false, "mediaType": "print"}` |
| Archive copy that looks exactly like the site, one page | `{"urls": [...], "onePage": true}` |
| Page numbers and URL in the footer | `{"urls": [...], "headerFooter": true}` |
| Fit a wide dashboard | `{"urls": [...], "landscape": true, "scale": "0.8"}` |
| Mobile layout as PDF | `{"urls": [...], "device": "mobile"}` |
| Weekly archive of your pages | Save the input as a task and add a **Schedule** |

Other options: `waitUntil`, `delayMs`, `waitForSelector`, `hideCookieBanners` (on), `hideSelectors`, `darkMode`, `scrollToBottom` (on, loads lazy images), `blockTrackers` (on, skips analytics / ad / chat scripts), `blockMedia`, `viewportWidth` / `viewportHeight`, `maxConcurrency`, `pageTimeoutSecs`, `maxRetries`, `proxyConfiguration`.

### Pricing

**$1.80 per 1,000 PDFs** (`result` event, $0.0018 each, however many pages a PDF has) **plus Apify platform usage** (the browser's compute time). No start fee.

| PDFs | Event price |
|---|---|
| 100 | $0.18 |
| 1,000 | $1.80 |
| 10,000 | $18.00 |

Measured usage on 3 Dec 2026 (default 4 GB memory): the prefilled 3-URL run used **$0.0059** of platform usage, so a first run on the Apify free plan costs about **$0.011 in total**. Usage per page is the same browser work as a screenshot: about $1.30 per 1,000 heavy brand home pages in our 40-site test, less for light pages.

Not charged: URLs that fail to load (DNS errors, timeouts, direct file downloads) and pages that answer HTTP 4xx / 5xx (still saved, with `charged: false`).

### Price compared (Apify Store, checked 3 Dec 2026)

| Actor | Users (30 days) | Price per 1,000 |
|---|---|---|
| **This actor** | new | **$1.80 + usage** |
| moonweil/url-screenshot-api (screenshots + PDF) | 163 | $4.00 + $0.001 start |
| autofacts/universal-web-printer | 7 | $4.00 per render |
| automation-lab/html-to-pdf-converter | 14 | $5.75 + $0.005 start |
| rainminer/html-to-pdf-converter | 5 | $9.99 |
| power_on/screenshot-url-pdf | 7 | $10.00 |
| apify/html-to-pdf-converter | 8 | free actor, usage only (converts HTML you paste, not URL lists) |

Rival speed was not measured.

### Use cases

- **Web archiving and evidence**: dated PDF copies of terms pages, product pages, prices or public notices.
- **Reports and documentation**: turn docs, dashboards or blog posts into shareable PDFs.
- **Offline reading and research**: batch-convert reading lists.
- **RAG / document AI pipelines**: feed PDFs to tools that expect documents.
- **Agencies**: monthly PDF snapshots of client sites.

### Integrations

Run it from the Apify API, Make, Zapier, n8n or the Apify MCP server. Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("rel8ble/url-to-pdf-converter").call(run_input={"urls": ["https://en.wikipedia.org/wiki/PDF"], "paperFormat": "Letter"})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["url"], row["pageCount"], row["pdfUrl"])
```

PDF links need your Apify token (or open them from the console) unless you make the run's storage public.

### Related actors

- [Website Screenshot API](https://apify.com/rel8ble/website-screenshot-api) - the same engine, PNG / JPEG screenshots.
- [PDF Text Extractor](https://apify.com/rel8ble/pdf-text-extractor) - text out of existing PDF files.

### FAQ

**Can it convert pages behind a login?** No. Public pages only, no cookies or accounts.

**Why does a page look different from my browser's "Print"?** By default the actor uses the screen stylesheet so the PDF looks like the website. Set `mediaType` to `print` to use the site's print stylesheet instead.

**A URL points straight at a PDF file.** That is a download, not a page: it is reported in `RUN_SUMMARY` and not charged.

**Some big shops show an error page.** A few sites block data-centre IPs. You get their error page with `charged: false`; turn on Apify Proxy (residential) for those.

Need a custom scraper or a ready dataset? Hire me on Fiverr: https://www.fiverr.com/rel8ble

# Actor input Schema

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

Web pages to convert, one per line (1 to 50,000). Bare domains like example.com get https:// added. Duplicates are skipped.

## `paperFormat` (type: `string`):

Page size of the PDF.

## `landscape` (type: `boolean`):

Landscape orientation instead of portrait.

## `onePage` (type: `boolean`):

Save the whole web page as a single tall PDF page, the width of the viewport. Good for archiving and visual records.

## `marginMm` (type: `integer`):

Same margin on all four sides, 0-50 mm.

## `printBackground` (type: `boolean`):

Keep background colours and images (off = printer-friendly white).

## `mediaType` (type: `string`):

Render with the screen or the print stylesheet.

## `scale` (type: `string`):

Zoom of the rendering, 0.1-2 (default 1). Use 0.8 to fit wide pages.

## `headerFooter` (type: `boolean`):

Add the page title on top and the URL plus 'page n / total' at the bottom of every page.

## `device` (type: `string`):

Viewport used to lay out the page before printing (desktop 1280 px wide by default). Mobile gives the phone layout.

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

Overrides the device width (200-3840).

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

Overrides the device height (200-4320).

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

When to capture. load (default) and networkidle are waited for at most 10-15 s after the HTML is ready, so one slow ad script never fails a capture.

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

Wait this long after loading, before the capture (animations, charts). 0-30000.

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

Optional: wait up to 15 s for this element to appear before capturing (e.g. #chart).

## `hideCookieBanners` (type: `boolean`):

Hide common consent popups (OneTrust, Cookiebot, Didomi, Quantcast, Usercentrics, CookieYes, ...) with CSS. Nothing is clicked or accepted.

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

CSS selectors to hide before capturing, e.g. .chat-widget or #newsletter-popup.

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

Emulate prefers-color-scheme: dark.

## `scrollToBottom` (type: `boolean`):

Scroll down first so lazy images load (on by default).

## `blockMedia` (type: `boolean`):

Skip loading video / audio files (faster, poster images stay).

## `blockTrackers` (type: `boolean`):

Skip analytics, ad and chat-widget scripts (Google Analytics / Tag Manager, Facebook pixel, Hotjar, Intercom, ...). Faster and cheaper; the page looks the same.

## `maxResults` (type: `integer`):

Stop after this many URLs (0 = all).

## `maxConcurrency` (type: `integer`):

Pages rendered at the same time (1-20). Memory limits it automatically.

## `pageTimeoutSecs` (type: `integer`):

Navigation timeout per page (5-180).

## `maxRetries` (type: `integer`):

Retries per failed URL (0-5). Failed URLs are never charged.

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

Optional. Off by default (direct datacenter connection). Turn on Apify Proxy for geo-specific pages.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://docs.apify.com/academy/web-scraping-for-beginners",
    "https://www.python.org/about/"
  ],
  "paperFormat": "A4",
  "landscape": false,
  "onePage": false,
  "marginMm": 10,
  "printBackground": true,
  "mediaType": "screen",
  "headerFooter": false,
  "device": "desktop",
  "waitUntil": "load",
  "delayMs": 500,
  "hideCookieBanners": true,
  "darkMode": false,
  "blockMedia": false,
  "blockTrackers": true,
  "maxResults": 0,
  "maxConcurrency": 5,
  "pageTimeoutSecs": 30,
  "maxRetries": 2
}
```

# Actor output Schema

## `pdfs` (type: `string`):

One row per URL: direct PDF link, title, page count, paper size.

## `files` (type: `string`):

The PDF files themselves.

## `summary` (type: `string`):

Saved / failed counts, total pages, failures with reasons, input warnings.

# 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://en.wikipedia.org/wiki/Web_scraping",
        "https://docs.apify.com/academy/web-scraping-for-beginners",
        "https://www.python.org/about/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rel8ble/url-to-pdf-converter").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://en.wikipedia.org/wiki/Web_scraping",
        "https://docs.apify.com/academy/web-scraping-for-beginners",
        "https://www.python.org/about/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rel8ble/url-to-pdf-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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://en.wikipedia.org/wiki/Web_scraping",
    "https://docs.apify.com/academy/web-scraping-for-beginners",
    "https://www.python.org/about/"
  ]
}' |
apify call rel8ble/url-to-pdf-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rel8ble/url-to-pdf-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/16NJExWSRjjveXUV5/builds/53Vyv3ptvsNfCMSYv/openapi.json
