# Convert web pages to PDF

**Use case:** 

Saves each URL as a clean A4 PDF with background graphics, after hiding cookie banners and pop-ups. Good for archiving articles, documentation, invoices or compliance evidence. Change the paper size or switch to landscape in the input.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://www.python.org/about/"
  ],
  "format": "pdf",
  "fullPage": true,
  "device": "desktop-1440",
  "quality": 80,
  "hideCookieBanners": true,
  "hidePopups": true,
  "blockAds": true,
  "blockVideo": true,
  "waitUntil": "networkidle2",
  "delayMs": 500,
  "scrollToBottom": true,
  "darkMode": false,
  "maxHeight": 20000,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "timeoutSecs": 60,
  "retries": 1,
  "failOnHttpError": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "url": {
    "label": "Page",
    "format": "string"
  },
  "fileUrl": {
    "label": "File",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "device": {
    "label": "Device",
    "format": "string"
  },
  "chargedEvent": {
    "label": "Charged event",
    "format": "string"
  },
  "width": {
    "label": "Width",
    "format": "integer"
  },
  "height": {
    "label": "Height",
    "format": "integer"
  },
  "statusCode": {
    "label": "Status code",
    "format": "integer"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "loadMs": {
    "label": "Load ms",
    "format": "integer"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

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

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

### 2. Start the "Convert web pages to PDF" task

The Website Screenshot & PDF: Full-Page, Mobile, No Cookie Banners 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 web pages to 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 page, file, format, 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" task via API](https://apify.com/datapipelabs/website-screenshot-pdf.md).

## FAQ

### What does the website to PDF task produce?

The website to PDF task saves each URL as a PDF document, A4 portrait by default with background graphics, after hiding cookie banners and pop-ups. Each PDF gets a direct download link.

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

Converting a web page to PDF costs $0.004 per PDF ($4 per 1,000), plus a start fee of $0.00005 per GB of run memory. Pages that fail to load are not charged.

### Can I change the paper size or orientation?

Yes. The website to PDF task supports A4, Letter, Legal and A3 paper, portrait or landscape, with background graphics on or off.

### Does the PDF contain the whole page?

The website to PDF task renders the entire page across as many PDF pages as needed, which is why every PDF is billed as a full-page capture.

### Can I convert pages behind a login?

No. The website to PDF task captures public pages as an anonymous visitor sees them. Pages that need a login are not supported.

### How do I convert many URLs at once?

Add all URLs to the urls field. The website to PDF task processes them in parallel and lists every PDF with its link in the dataset.

## About this Actor

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