# Save web pages as PDF

**Use case:** 

Save a list of web pages as A4 PDF files (example: two Wikipedia articles), ready to archive or share. One PDF and link per page.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://en.wikipedia.org/wiki/Search_engine_optimization"
  ],
  "format": "pdf",
  "fullPage": false,
  "viewport": "desktop",
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "darkMode": false,
  "hideCookieBanners": true,
  "blockAds": false,
  "waitUntil": "load",
  "delayMs": 1000,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "maxFullPageHeight": 10000,
  "timeoutSecs": 30,
  "maxConcurrency": 2,
  "maxUrls": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "screenshotUrl": {
    "label": "Screenshot",
    "format": "image"
  },
  "url": {
    "label": "URL",
    "format": "link"
  },
  "title": {
    "label": "Page title",
    "format": "text"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "width": {
    "label": "Width (px)",
    "format": "number"
  },
  "height": {
    "label": "Height (px)",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "statusCode": {
    "label": "HTTP",
    "format": "number"
  },
  "loadTimeMs": {
    "label": "Load (ms)",
    "format": "number"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

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

The Website Screenshot API: Full Page, Mobile, PDF 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/pQbjlCQa4zYfwXoIT) 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 Actor will start running based on the input automatically. You can also change all the input fields, like URLs, format, 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, page title, 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/fjordlabs/website-screenshot.md).

## FAQ

### Can I use another paper size than A4?

Yes. PDF paper size also takes Letter, Legal, A3, A5 and Tabloid. Each PDF is saved in the run's key-value store with a direct download link in its dataset row.

### What information does the output include for each URL?

The output includes the screenshot URL, original URL, page title, format, dimensions, content size, HTTP status code, load time, and any errors.

### What happens if a URL fails to load during the task?

Failed URLs are returned for free and include an error message, without incurring charges.

### How much does this task cost?

$0.002 per PDF ($2 per 1,000), the same price as a PNG or JPEG screenshot, plus Apify's $0.00005 run-start fee. Failed URLs are free.

### Can it save pages behind a login?

No. It only opens public pages, follows each site's robots.txt and refuses private network addresses. Pages behind a login show the login screen.

## About this Actor

This example demonstrates how to use [Website Screenshot API: Full Page, Mobile, PDF](https://apify.com/fjordlabs/website-screenshot.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/fjordlabs/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/fjordlabs/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`).
