# Convert web pages to PDF (A4, Letter)

**Use case:** 

Prints web pages to PDF in A4, Letter, Legal, A3 or A5 with backgrounds kept, for archiving, reports or sharing. Works for a list of URLs in one run and returns a link to each PDF. This example prints a public demo quotes page as A4.

## Input

```json
{
  "urls": [
    "https://quotes.toscrape.com/"
  ],
  "format": "pdf",
  "fullPage": false,
  "device": "desktop",
  "hideCookieBanners": true,
  "darkMode": false,
  "delayMs": 0,
  "pageTimeoutSecs": 30,
  "maxHeight": 10000,
  "viewportWidth": 0,
  "viewportHeight": 0,
  "scale": 0,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "respectRobotsTxt": true
}
```

## Output

```json
{
  "fileIndex": {
    "label": "#",
    "format": "number"
  },
  "url": {
    "label": "Page",
    "format": "link"
  },
  "status": {
    "label": "Status"
  },
  "fileUrl": {
    "label": "File",
    "format": "link"
  },
  "httpStatus": {
    "label": "HTTP",
    "format": "number"
  },
  "title": {
    "label": "Title"
  },
  "format": {
    "label": "Format"
  },
  "width": {
    "label": "Width",
    "format": "number"
  },
  "height": {
    "label": "Height",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "charged": {
    "label": "Charged",
    "format": "boolean"
  },
  "error": {
    "label": "Error"
  },
  "note": {
    "label": "Note"
  }
}
```

## How it works

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

The Website Screenshot & HTML to Image / PDF Actor is ready to run with the inputs already set for "Convert web pages to PDF (A4, Letter)". [Sign up or log in](https://console.apify.com/create-task-from-example/F4u8BgneYQTGdlSkm) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert web pages to PDF (A4, Letter)" task

The Website Screenshot & HTML to Image / 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 "Convert web pages to PDF (A4, Letter)" 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 #, page, 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 "Convert web pages to PDF (A4, Letter)" task via API](https://apify.com/klarto/website-screenshot-pdf.md).

## FAQ

### Which paper sizes does the web page to PDF task support?

The web page to PDF task prints A4, Letter, Legal, A3 and A5 pages.

### How much does converting a web page to PDF cost?

Converting a web page to PDF costs $0.005 per page URL. Failed pages and pages with HTTP errors are free.

### Does the web page to PDF task follow robots.txt?

Yes. The web page to PDF task skips URLs that robots.txt disallows by default; those pages are free.

## About this Actor

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