# Convert Websites to PDF with Page Numbers

**Use case:** 

Turn any web page into a clean PDF. Choose A4, Letter, Legal, A3, A5 or Tabloid, portrait or landscape, margins and page numbers, or save the whole page as one long PDF with no page breaks. Cookie banners are refused and ads blocked before printing, and lazy-loaded images are loaded first. Paste your URLs and start: each page gives one PDF with a direct download link.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_page",
    "https://developer.mozilla.org/en-US/docs/Web/HTML"
  ],
  "maxSitemapPages": 100,
  "format": "pdf",
  "devices": [
    "desktop"
  ],
  "width": 1280,
  "height": 800,
  "deviceScaleFactor": 1,
  "fullPage": true,
  "maxHeight": 20000,
  "quality": 85,
  "transparentBackground": false,
  "colorScheme": "light",
  "cookieBanners": "reject",
  "blockAds": true,
  "waitUntil": "load",
  "delayMs": 0,
  "scrollToLoad": true,
  "timeoutSecs": 45,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfMargin": "15mm",
  "pdfMedia": "screen",
  "pdfSinglePage": false,
  "pdfPageNumbers": true,
  "pdfPrintBackground": true,
  "pdfScale": 1,
  "locale": "en-US",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxConcurrency": 0,
  "maxRetries": 1,
  "includeBase64": false
}
```

## Output

```json
{
  "preview": {
    "label": "Preview",
    "format": "image"
  },
  "fileUrl": {
    "label": "File",
    "format": "link"
  },
  "url": {
    "label": "Page",
    "format": "link"
  },
  "device": {
    "label": "Device",
    "format": "text"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "width": {
    "label": "Width (px)",
    "format": "number"
  },
  "height": {
    "label": "Height (px)",
    "format": "number"
  },
  "sizeKb": {
    "label": "Size (KB)",
    "format": "number"
  },
  "statusCode": {
    "label": "HTTP",
    "format": "number"
  },
  "title": {
    "label": "Page title",
    "format": "text"
  },
  "cookieBanner": {
    "label": "Cookie banner",
    "format": "text"
  },
  "charged": {
    "label": "Charged",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

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

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

### 2. Start the "Convert Websites to PDF with Page Numbers" task

The Website Screenshot & PDF Generator Actor will start running based on the input automatically. You can also change all the input fields, like URLs, max pages from the sitemap, and more, to match your specific use case.

### 3. Receive the "Convert Websites to PDF with Page Numbers" 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 preview, file, page, 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 Websites to PDF with Page Numbers" task via API](https://apify.com/webthreenity/website-screenshot-pdf.md).

## About this Actor

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