# Save web pages as PDF files for archiving

**Use case:** 

Opens each web page in a real Chrome browser and prints it to a PDF file with background colors and images, like the page looks on screen. Cookie banners and ads are hidden. You get a download link for each PDF plus the page title, HTTP status, page count, file size and capture time, which is handy for archiving, compliance records and reports.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_archiving",
    "https://www.gov.uk/browse/business"
  ],
  "datasetUrlField": "url",
  "maxUrls": 100,
  "format": "pdf",
  "fullPage": false,
  "quality": 80,
  "maxFullPageHeight": 20000,
  "device": "desktop",
  "viewportWidth": 0,
  "viewportHeight": 0,
  "deviceScaleFactor": 0,
  "darkMode": false,
  "hideCookieBanners": true,
  "hideAds": true,
  "hideChatWidgets": false,
  "waitUntil": "load",
  "delayMs": 1000,
  "scrollDelayMs": 200,
  "navigationTimeoutSecs": 30,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "pdfMediaType": "screen",
  "pdfMarginMm": 0,
  "monitorMode": false,
  "monitorStoreName": "screenshot-monitor",
  "changeThresholdPercent": 0,
  "pixelThreshold": 0.1,
  "outputUnchanged": false,
  "saveDiffImage": true,
  "updateBaseline": "on-change",
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "fileUrl": {
    "label": "Capture",
    "format": "image"
  },
  "url": {
    "label": "URL",
    "format": "link"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "httpStatus": {
    "label": "HTTP",
    "format": "number"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "captureType": {
    "label": "Type",
    "format": "text"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "device": {
    "label": "Device",
    "format": "text"
  },
  "width": {
    "label": "Width",
    "format": "number"
  },
  "height": {
    "label": "Height",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "pdfPages": {
    "label": "PDF pages",
    "format": "number"
  },
  "truncated": {
    "label": "Cut",
    "format": "boolean"
  },
  "monitorStatus": {
    "label": "Monitor",
    "format": "text"
  },
  "changedPercent": {
    "label": "Changed %",
    "format": "number"
  },
  "error": {
    "label": "Note",
    "format": "text"
  },
  "capturedAt": {
    "label": "Captured",
    "format": "date"
  }
}
```

## How it works

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

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

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

The Website Screenshot & PDF API with Visual Change Monitor Actor will start running based on the input automatically. You can also change all the input fields, like URLs to capture, dataset url field, and more, to match your specific use case.

### 3. Receive the "Save web pages as PDF files for archiving" 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 capture, URL, status, 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 files for archiving" task via API](https://apify.com/zhtech/website-screenshot-monitor.md).

## FAQ

### What does the save web pages as PDF task return?

The save web pages as PDF task returns one row per URL with the PDF download link, page title, HTTP status, number of PDF pages, file size and capture time. The PDF files are stored in the run's key value store.

### How do I change the paper size or get images instead of PDFs?

Set PDF paper size in the save web pages as PDF task to Letter, Legal or A3, or switch Output format to PNG, JPEG or WebP for screenshots. Landscape and margins are in the full input.

### Can I run the save web pages as PDF task on a schedule or through the API?

Save the save web pages as PDF task to your Apify account, then add it to an Apify Schedule (for example daily) or start it from the Apify API, webhooks, Zapier, Make, n8n or the Apify MCP server for AI agents.

### How much does the save web pages as PDF task cost?

The save web pages as PDF task is pay per event: a small start fee per run plus a fee per PDF saved. Errors, timeouts and blocked pages are free. Prices are on the Pricing tab.

## About this Actor

This example demonstrates how to use [Website Screenshot & PDF API with Visual Change Monitor](https://apify.com/zhtech/website-screenshot-monitor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/zhtech/website-screenshot-monitor.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/zhtech/website-screenshot-monitor.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`).
