# Save web pages as PDF

**Use case:** 

Turns each URL into an A4 PDF that looks like the page on screen, with selectable text and backgrounds. Cookie banners are hidden first. Good for archiving pages, invoices and articles.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Portable_Document_Format"
  ],
  "devices": [
    "desktop"
  ],
  "mode": "fullPage",
  "format": "pdf",
  "height": 1200,
  "quality": 80,
  "hideCookieBanners": true,
  "stickyElements": "smart",
  "blockAds": true,
  "darkMode": false,
  "waitUntil": "smart",
  "scrollToLoad": true,
  "delay": 0,
  "timeoutSecs": 45,
  "maxHeight": 20000,
  "pdfFormat": "A4",
  "pdfMedia": "screen"
}
```

## Output

```json
{
  "screenshotUrl": {
    "label": "Screenshot",
    "format": "string"
  },
  "url": {
    "label": "URL",
    "format": "string"
  },
  "device": {
    "label": "Device",
    "format": "string"
  },
  "statusCode": {
    "label": "HTTP",
    "format": "integer"
  },
  "title": {
    "label": "Page title",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "width": {
    "label": "Width",
    "format": "integer"
  },
  "height": {
    "label": "Height",
    "format": "integer"
  },
  "ok": {
    "label": "OK",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Website Screenshot API: Full Page, Mobile, PDF & Bulk Actor is ready to run with the inputs already set for "Save web pages as PDF". [Sign up or log in](https://console.apify.com/create-task-from-example/HG0M4BYtIcot33JL9) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Save web pages as PDF" task

The Website Screenshot API: Full Page, Mobile, PDF & Bulk Actor will start running based on the input automatically. You can also change all the input fields, like URLs, devices, and more, to match your specific use case.

### 3. Receive the "Save web pages as PDF" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as screenshot, URL, device, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Save web pages as PDF" task via API](https://apify.com/makerio/website-screenshot.md).

## FAQ

### What does the web page to PDF task return?

One file per page and device in the run's key-value store, plus a table row with the download link, page title, HTTP status, device and image size.

### How much does one run of this task cost?

$0.004 per saved screenshot (full page or PDF); pages that fail are free. As set up, with 1 screenshot(s), one run costs about $0.0040.

### Can I use my own URLs?

Yes. Duplicate the "Save web pages as PDF" task and paste your URLs, one per line. You can also change devices, format and what part of the page to capture.

### Can I run it on a schedule?

Yes. Add a schedule in Apify Console to keep a dated screenshot of the same pages every day or week, and send results to Google Drive, Slack, email or a webhook.

## About this Actor

This example demonstrates how to use [Website Screenshot API: Full Page, Mobile, PDF & Bulk](https://apify.com/makerio/website-screenshot.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/makerio/website-screenshot.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/makerio/website-screenshot.md

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`).
