# Convert a web page to an A4 PDF

**Use case:** 

Save a public web page as an A4 PDF with backgrounds printed. Paste one or more URLs and get one PDF per page, stored in your Apify key-value store with a download link in the dataset. Change the paper size (Letter, Legal, A3, A5, Tabloid), orientation, margin or scale in the input.

## Input

```json
{
  "urls": [
    "https://example.com/"
  ],
  "outputFormat": "pdf",
  "fullPage": false,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "waitUntil": "load",
  "delayMs": 0,
  "scrollToLoadLazy": true,
  "maxFullPageHeight": 16000,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "pdfMarginMm": 0,
  "pdfScale": 1,
  "hideCookieBannersAndAds": true,
  "timeoutSecs": 30,
  "maxConcurrency": 3,
  "ignoreRobotsTxt": false,
  "overrideDomainStop": false
}
```

## Output

```json
{
  "index": {
    "label": "Index"
  },
  "url": {
    "label": "Url"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "format": {
    "label": "Format"
  },
  "bytes": {
    "label": "Bytes"
  },
  "link": {
    "label": "File",
    "format": "link"
  },
  "httpStatus": {
    "label": "Http status"
  },
  "charged": {
    "label": "Charged"
  },
  "chargedEvents": {
    "label": "Charged events"
  },
  "chargeUnconfirmed": {
    "label": "Charge unconfirmed (restart or charge error)",
    "format": "boolean"
  },
  "chargeStatus": {
    "label": "Charge status"
  },
  "pdfPages": {
    "label": "Pdf pages"
  },
  "truncated": {
    "label": "Truncated (PDF: estimate)",
    "format": "boolean"
  },
  "imagesLoaded": {
    "label": "Images loaded",
    "format": "text"
  },
  "warnings": {
    "label": "Warnings",
    "format": "array"
  },
  "robotsBlockedRequests": {
    "label": "Robots blocked requests"
  },
  "attempts": {
    "label": "Attempts"
  },
  "timingMs": {
    "label": "Timing (ms)",
    "format": "object"
  },
  "error": {
    "label": "Error"
  }
}
```

## How it works

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

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

### 2. Start the "Convert a web page to an A4 PDF" task

The Website Screenshot & URL to PDF Converter Actor will start running based on the input automatically. You can also change all the input fields, like URLs, output format, and more, to match your specific use case.

### 3. Receive the "Convert a web page to an A4 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 index, 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 "Convert a web page to an A4 PDF" task via API](https://apify.com/luxe_tasks/screenshot-pdf.md).

## FAQ

### What does the Convert a web page to an A4 PDF task return?

The Convert a web page to an A4 PDF task returns one PDF file per URL in the run's key-value store, and one dataset record per URL with the status, page count and a download link.

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

The Convert a web page to an A4 PDF task costs $0.003 per delivered PDF page plus a start fee of $0.01 per run at the default 2 GB of memory. Failed URLs have no per-page charge; the start fee still applies.

### Can this task convert pages behind a login?

No. The Convert a web page to an A4 PDF task opens only public URLs and does not accept passwords, cookies or session tokens.

## About this Actor

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