# Website to PDF: Bulk URL & Web Page to PDF Converter (`forgeloop/website-to-pdf`) Actor

Convert web pages to PDF in bulk with a real Chrome browser. A4, Letter and other paper formats, landscape, margins, backgrounds and lazy-loaded content. Archive pages, create reports, save invoices and receipts. Direct PDF links in the output. Pay per PDF.

- **URL**: https://apify.com/forgeloop/website-to-pdf.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 pdfs

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/actors/running/actors-in-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

## Website to PDF: Bulk URL & Web Page to PDF Converter

Turn any list of web pages into PDF files in one run. Each page is rendered in a real Chromium browser, so the PDF looks like the website, with fonts, images and background colors. Every result has a direct link to the PDF.

Good for archiving pages for compliance or evidence, saving articles and documentation for offline reading, sending web reports to people who want a file, and feeding documents into tools that only take PDF.

### Features

- **Real browser rendering** with JavaScript, web fonts and images.
- **Paper formats:** A4, Letter, Legal and A3, portrait or landscape.
- **Screen or print style.** Screen keeps the look of the website. Print uses the site's own print stylesheet, which often drops menus and ads.
- **Margins and scale** to fit wide pages or get more on each sheet.
- **Background graphics** on or off.
- **Lazy images** load before printing, thanks to automatic scrolling.
- **Hide elements** such as cookie banners or chat widgets with CSS selectors.
- **Parallel rendering** of several pages at once.
- Clear error per URL. Failed pages are not charged.

### Input

| Field | Description | Default |
|---|---|---|
| URLs | Web pages to convert | |
| Paper format | A4, Letter, Legal, A3 | A4 |
| Landscape | Turn the paper sideways | off |
| Print background graphics | Keep colors and background images | on |
| Page style | Screen (looks like the website) or print | screen |
| Margin (mm) | Margin on all sides, 0 to 50 | 10 |
| Scale | Content zoom, 0.1 to 2 | 1 |
| Hide elements | CSS selectors to remove before printing | none |
| Wait until | load, DOM ready or network idle | load |
| Extra delay | Seconds to wait after loading | 1 |
| Scroll to load lazy images | Scroll through the page first | on |
| Page timeout | Seconds before a page is given up | 60 |
| Parallel pages | Pages rendered at the same time, 1 to 10 | 3 |

### Output

One dataset item per URL. The PDF itself is stored in the run's key-value store and linked in `pdfUrl`.

```json
{
  "url": "https://en.wikipedia.org/wiki/Markdown",
  "finalUrl": "https://en.wikipedia.org/wiki/Markdown",
  "title": "Markdown - Wikipedia",
  "statusCode": 200,
  "paperFormat": "A4",
  "landscape": false,
  "pages": 9,
  "bytes": 633321,
  "pdfKey": "en-wikipedia-org-a4-268c61c0a3.pdf",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/en-wikipedia-org-a4-268c61c0a3.pdf",
  "createdAt": "2026-11-11T08:00:00.000Z",
  "error": null
}
```

A failed page returns the URL and an `error` text, for example a domain that does not exist.

### Pricing

Pay per created PDF. Errors cost nothing. You can cap the cost of a run with the maximum charge setting in Apify.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- Pages behind a login are not supported.
- Some sites block automated browsers or show a cookie wall. Use "Hide elements" for banners.
- Pages that build their layout only on scroll or with fixed full-screen sections may print with gaps or overlaps. Try the print page style.
- Only public addresses. Local and private network addresses are refused.

### Data source, permitted use and legal

- **Data source:** Public web pages at the URLs you enter. The Actor fetches them live during the run.
- **Snapshot:** Results show the source at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Process only content you are allowed to access and use, for example your own websites and documents or public pages you have a legitimate reason to process. Respect the terms of the websites and the rights in the content.
- **Your responsibility:** You choose the URLs and decide what happens with the results. If results contain personal data, you are the controller and need your own legal basis.
- **No circumvention:** The Actor does not log in, solve captchas or bypass paywalls, bot protection or other access restrictions. Do not use it for that.
- **Request volume:** One page load per URL, including the resources the page loads itself, like a normal browser visit. At most 10 pages in parallel (default 3). Do not use it to put excessive load on a website.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

Web pages to convert. A missing https:// is added automatically. One PDF per URL. Format: a list of objects with a url key, like \[{"url": "https://example.com"}]. Plain strings are not accepted. Each successful URL is one charged PDF.

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

Page size of the PDF.

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

Turn the paper sideways. Useful for wide tables and dashboards.

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

Keep background colors and images, like in the browser. Off gives a plain white background and smaller files.

## `emulateMedia` (type: `string`):

Screen keeps the look of the website. Print uses the site's print stylesheet, which often removes menus and ads.

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

Margin on all four sides in millimeters. 0 to 50.

## `scale` (type: `number`):

Zoom of the page content. 1 is 100 %. Lower values fit more on a page. 0.1 to 2.

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

CSS selectors of elements to remove before printing, for example cookie banners or chat widgets: #cookie-banner, .intercom-launcher

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

When the page counts as loaded.

## `delaySeconds` (type: `integer`):

Wait this long after loading, for animations or late content.

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

Scroll through the page before printing so lazy-loaded images appear in the PDF.

## `timeoutSeconds` (type: `integer`):

Give up on a page after this many seconds.

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

How many pages are rendered at the same time.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://example.com"
    }
  ],
  "paperFormat": "A4",
  "landscape": false,
  "printBackground": true,
  "emulateMedia": "screen",
  "marginMm": 10,
  "scale": 1,
  "hideSelectors": [],
  "waitUntil": "load",
  "delaySeconds": 1,
  "scrollToBottom": true,
  "timeoutSeconds": 60,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `results` (type: `string`):

No description

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

No description

# 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": [
        {
            "url": "https://en.wikipedia.org/wiki/Markdown"
        },
        {
            "url": "https://example.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/website-to-pdf").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": [
        { "url": "https://en.wikipedia.org/wiki/Markdown" },
        { "url": "https://example.com" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/website-to-pdf").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": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://example.com"
    }
  ]
}' |
apify call forgeloop/website-to-pdf --silent --output-dataset

```

## MCP server setup

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

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/rxMrHd3FdwHpGhQs0/builds/O0ZuhSlDD9bbFYy4U/openapi.json
