# URL to PDF (`reinventingai/url-to-pdf`) Actor

Convert webpages, dashboards, invoices, and authenticated app screens into clean PDFs with advanced controls. Supports JavaScript waits, cookies, headers, print settings, PDF/A, PDF/UA, watermarks, attachments, and post-processing. Ideal for reports, archives, and automation workflows.

- **URL**: https://apify.com/reinventingai/url-to-pdf.md
- **Developed by:** [Mark Fulton](https://apify.com/reinventingai) (community)
- **Categories:** Automation, Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 pdf converteds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## URL to PDF

Convert webpages, dashboards, reports, invoices, and authenticated app screens into clean downloadable PDFs.

This Apify Actor is built for anyone who needs a reliable **URL to PDF converter** for automation workflows, reporting, archiving, client deliverables, or printable web content. It supports simple one-page exports and more advanced document generation from JavaScript-heavy or logged-in pages.

### Great for

- saving webpages as PDF
- exporting dashboards and analytics views
- generating invoice or contract PDFs from web apps
- archiving articles, landing pages, and reports
- producing compliance-friendly PDFs with metadata, PDF/A, or PDF/UA options

Under the hood it uses [Gotenberg](https://github.com/gotenberg/gotenberg) Chromium and exposes advanced controls in Apify, including:

- page size, margins, landscape, scale, single-page mode
- print backgrounds, screen vs print media emulation, emulated media features
- JavaScript waits (`waitDelay`, `waitForExpression`, `waitForSelector`)
- cookies and custom HTTP headers for authenticated pages
- strict failure rules for HTTP status codes, resource loading, and console exceptions
- header and footer HTML
- document outline, tagged PDFs, PDF/A, PDF/UA, metadata, flattening, encryption
- embeds/attachments
- split, watermark, stamp, and rotate post-processing

### Input

Use `url` for one page or `urls` for several pages in one run.

#### Minimal example

```json
{
  "url": "https://example.com"
}
````

#### Backgrounds + JS wait

```json
{
  "url": "https://example.com/dashboard",
  "printBackground": true,
  "waitForSelector": "#app-ready",
  "outputFilename": "dashboard-export"
}
```

#### Authenticated page with cookies

```json
{
  "url": "https://app.example.com/invoice/123",
  "cookies": "[{\"name\":\"session\",\"value\":\"abc\",\"domain\":\"app.example.com\",\"path\":\"/\",\"secure\":true,\"httpOnly\":true}]",
  "printBackground": true
}
```

#### Header/footer HTML

```json
{
  "url": "https://example.com/report",
  "headerHtml": "<html><head><style>html{-webkit-print-color-adjust:exact;font-size:16px;margin:0 20px;}</style></head><body><p>Monthly Report</p></body></html>",
  "footerHtml": "<html><head><style>html{-webkit-print-color-adjust:exact;font-size:16px;margin:0 20px;}</style></head><body><p>Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></p></body></html>"
}
```

#### Watermark + PDF/A

```json
{
  "url": "https://example.com/contract",
  "watermarkSource": "text",
  "watermarkExpression": "CONFIDENTIAL",
  "watermarkOptions": "{\"opacity\":0.18,\"rotation\":45,\"points\":48}",
  "pdfa": "PDF/A-3b",
  "pdfua": true,
  "generateTaggedPdf": true
}
```

#### Attach files into the PDF

```json
{
  "url": "https://example.com/invoice",
  "embeds": "[{\"url\":\"https://example.com/factur-x.xml\",\"fileName\":\"factur-x.xml\",\"mimeType\":\"text/xml\",\"relationship\":\"Alternative\"}]"
}
```

### Important notes

#### 1. Asset-based features use URLs in this actor

Apify actor inputs do not provide a native file-upload widget.

Because of that, file-backed Gotenberg features are exposed through URL-based inputs:

- `embeds` expects attachment URLs
- `watermarkFileUrl` downloads the watermark image/PDF
- `stampFileUrl` downloads the stamp image/PDF
- `headerHtml` and `footerHtml` accept inline HTML strings

#### 2. Some runs return ZIP instead of PDF

If you use split post-processing and Gotenberg returns multiple files, the actor stores a ZIP in the default key-value store instead of a single PDF.

#### 3. Private-network targets are blocked by default

For safety, the bundled Gotenberg service starts with private-IP access disabled. This actor is meant for public web URLs, authenticated web apps, and downloadable public assets, not intranet SSRF-style access.

### Output

Each successful item includes:

- `requestedUrl`
- `gotenbergTrace`
- `outputType` (`pdf` or `zip`)
- `output.key`
- `output.fileName`
- `output.sizeBytes`
- `output.url`

Generated files are stored in the default key-value store.

### Standby mode

The actor also exposes a lightweight standby API:

- `GET /`
- `GET /convert?url=https://example.com&printBackground=true`
- `POST /convert` with JSON body

# Actor input Schema

## `url` (type: `string`):

A single public or authenticated URL to convert into PDF.

## `urls` (type: `array`):

Optional list of URLs to convert in sequence.

## `outputFilename` (type: `string`):

Optional base filename without extension. If multiple URLs are provided, the actor appends -1, -2, etc.

## `paperWidth` (type: `string`):

Optional paper width like 8.5in, 21cm, or 595pt.

## `paperHeight` (type: `string`):

Optional paper height like 11in, 29.7cm, or 842pt.

## `marginTop` (type: `string`):

Optional top margin like 0.39in or 1cm.

## `marginBottom` (type: `string`):

Optional bottom margin like 0.39in or 1cm.

## `marginLeft` (type: `string`):

Optional left margin like 0.39in or 1cm.

## `marginRight` (type: `string`):

Optional right margin like 0.39in or 1cm.

## `landscape` (type: `boolean`):

Render in landscape orientation.

## `scale` (type: `number`):

Optional Chromium scale factor, for example 1 or 0.9.

## `singlePage` (type: `boolean`):

Fit the entire output into one very long page.

## `preferCssPageSize` (type: `boolean`):

Use page sizes defined in CSS instead of API page size fields.

## `printBackground` (type: `boolean`):

Include background images and colors from the page.

## `omitBackground` (type: `boolean`):

Hide Chromium's default white background for transparent output where supported.

## `emulatedMediaType` (type: `string`):

Optional CSS media type to emulate.

## `emulatedMediaFeatures` (type: `string`):

Optional JSON array like \[{"name":"prefers-color-scheme","value":"dark"}].

## `waitDelay` (type: `string`):

Optional fixed wait like 5s before rendering.

## `waitForExpression` (type: `string`):

Optional JavaScript expression that must evaluate true before rendering.

## `waitForSelector` (type: `string`):

Optional CSS selector that must appear before rendering.

## `cookies` (type: `string`):

Optional JSON array of cookie objects for authenticated pages.

## `extraHttpHeaders` (type: `string`):

Optional JSON object of request headers, including scoped values with ;scope=regex if needed.

## `userAgent` (type: `string`):

Optional custom User-Agent string.

## `failOnHttpStatusCodes` (type: `string`):

Optional JSON array like \[499,599] to fail on matching main page responses.

## `failOnResourceHttpStatusCodes` (type: `string`):

Optional JSON array like \[499,599] to fail when page resources return matching codes.

## `ignoreResourceHttpStatusDomains` (type: `string`):

Optional JSON array of hostnames excluded from resource status code checks.

## `skipNetworkIdleEvent` (type: `boolean`):

Leave enabled to avoid waiting for zero open connections for 500ms.

## `skipNetworkAlmostIdleEvent` (type: `boolean`):

Leave enabled to avoid waiting for two or fewer open connections for 500ms.

## `failOnResourceLoadingFailed` (type: `boolean`):

Fail the conversion if images, CSS, or scripts hit network loading errors.

## `failOnConsoleExceptions` (type: `boolean`):

Fail the conversion when Chromium console exceptions occur.

## `headerHtml` (type: `string`):

Optional full HTML document used as header.html.

## `footerHtml` (type: `string`):

Optional full HTML document used as footer.html.

## `generateDocumentOutline` (type: `boolean`):

Embed PDF bookmarks based on heading tags.

## `metadata` (type: `string`):

Optional XMP metadata JSON object, for example {"Title":"My PDF","Author":"Mark"}.

## `embeds` (type: `string`):

Optional JSON array of attachment objects like \[{"url":"https://.../invoice.xml","fileName":"invoice.xml","mimeType":"text/xml","relationship":"Alternative"}].

## `flatten` (type: `boolean`):

Convert interactive form fields into static page content.

## `nativePageRanges` (type: `string`):

Optional Chromium print ranges like 1-3,5,8-10.

## `splitMode` (type: `string`):

Optional post-processing split mode.

## `splitSpan` (type: `string`):

Split chunk size or explicit page ranges, depending on splitMode.

## `splitUnify` (type: `boolean`):

When splitMode is pages, return one PDF instead of separate files per page range.

## `watermarkSource` (type: `string`):

Optional watermark source type.

## `watermarkExpression` (type: `string`):

Watermark text when watermarkSource is text. For image/pdf sources, provide watermarkFileUrl instead.

## `watermarkPages` (type: `string`):

Optional page ranges to watermark, like 1-3 or 5.

## `watermarkOptions` (type: `string`):

Optional JSON object for watermark options like opacity, color, rotation, font, points, scale, or offset.

## `watermarkFileUrl` (type: `string`):

Required when watermarkSource is image or pdf. Public URL of the watermark asset.

## `watermarkFileName` (type: `string`):

Optional filename override for the uploaded watermark asset.

## `stampSource` (type: `string`):

Optional stamp source type.

## `stampExpression` (type: `string`):

Stamp text when stampSource is text. For image/pdf sources, provide stampFileUrl instead.

## `stampPages` (type: `string`):

Optional page ranges to stamp, like 1-3 or 5.

## `stampOptions` (type: `string`):

Optional JSON object for stamp options like opacity, color, rotation, font, points, scale, or offset.

## `stampFileUrl` (type: `string`):

Required when stampSource is image or pdf. Public URL of the stamp asset.

## `stampFileName` (type: `string`):

Optional filename override for the uploaded stamp asset.

## `rotateAngle` (type: `string`):

Optional rotation angle applied during PDF post-processing.

## `rotatePages` (type: `string`):

Optional page ranges to rotate, like 1-2 or 5.

## `generateTaggedPdf` (type: `boolean`):

Embed Chromium logical structure tags for accessibility.

## `pdfa` (type: `string`):

Optional archival PDF/A conversion mode.

## `pdfua` (type: `boolean`):

Enable PDF/UA accessibility post-processing.

## `userPassword` (type: `string`):

Optional password required to open the PDF.

## `ownerPassword` (type: `string`):

Optional password used to control PDF editing and permissions.

## Actor input object example

```json
{
  "url": "https://example.com",
  "landscape": false,
  "scale": 1,
  "singlePage": false,
  "preferCssPageSize": false,
  "printBackground": false,
  "omitBackground": false,
  "emulatedMediaType": "print",
  "skipNetworkIdleEvent": true,
  "skipNetworkAlmostIdleEvent": true,
  "failOnResourceLoadingFailed": false,
  "failOnConsoleExceptions": false,
  "generateDocumentOutline": false,
  "flatten": false,
  "splitUnify": false,
  "generateTaggedPdf": false,
  "pdfua": false
}
```

# Actor output Schema

## `results` (type: `string`):

Structured conversion results returned by the actor dataset.

## `runSummary` (type: `string`):

Summary output stored under the OUTPUT record in the default key-value store.

## `files` (type: `string`):

Generated PDF or ZIP outputs stored in the default key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("reinventingai/url-to-pdf").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "url": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("reinventingai/url-to-pdf").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://example.com"
}' |
apify call reinventingai/url-to-pdf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=reinventingai/url-to-pdf",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "URL to PDF",
        "description": "Convert webpages, dashboards, invoices, and authenticated app screens into clean PDFs with advanced controls. Supports JavaScript waits, cookies, headers, print settings, PDF/A, PDF/UA, watermarks, attachments, and post-processing. Ideal for reports, archives, and automation workflows.",
        "version": "0.0",
        "x-build-id": "5FtJrEAqR4UGkrQJd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/reinventingai~url-to-pdf/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-reinventingai-url-to-pdf",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/reinventingai~url-to-pdf/runs": {
            "post": {
                "operationId": "runs-sync-reinventingai-url-to-pdf",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/reinventingai~url-to-pdf/run-sync": {
            "post": {
                "operationId": "run-sync-reinventingai-url-to-pdf",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "url": {
                        "title": "Single URL",
                        "type": "string",
                        "description": "A single public or authenticated URL to convert into PDF."
                    },
                    "urls": {
                        "title": "Multiple URLs",
                        "type": "array",
                        "description": "Optional list of URLs to convert in sequence.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "outputFilename": {
                        "title": "Base output filename",
                        "type": "string",
                        "description": "Optional base filename without extension. If multiple URLs are provided, the actor appends -1, -2, etc."
                    },
                    "paperWidth": {
                        "title": "Paper width",
                        "type": "string",
                        "description": "Optional paper width like 8.5in, 21cm, or 595pt."
                    },
                    "paperHeight": {
                        "title": "Paper height",
                        "type": "string",
                        "description": "Optional paper height like 11in, 29.7cm, or 842pt."
                    },
                    "marginTop": {
                        "title": "Top margin",
                        "type": "string",
                        "description": "Optional top margin like 0.39in or 1cm."
                    },
                    "marginBottom": {
                        "title": "Bottom margin",
                        "type": "string",
                        "description": "Optional bottom margin like 0.39in or 1cm."
                    },
                    "marginLeft": {
                        "title": "Left margin",
                        "type": "string",
                        "description": "Optional left margin like 0.39in or 1cm."
                    },
                    "marginRight": {
                        "title": "Right margin",
                        "type": "string",
                        "description": "Optional right margin like 0.39in or 1cm."
                    },
                    "landscape": {
                        "title": "Landscape",
                        "type": "boolean",
                        "description": "Render in landscape orientation.",
                        "default": false
                    },
                    "scale": {
                        "title": "Scale",
                        "type": "number",
                        "description": "Optional Chromium scale factor, for example 1 or 0.9.",
                        "default": 1
                    },
                    "singlePage": {
                        "title": "Single page",
                        "type": "boolean",
                        "description": "Fit the entire output into one very long page.",
                        "default": false
                    },
                    "preferCssPageSize": {
                        "title": "Prefer CSS @page size",
                        "type": "boolean",
                        "description": "Use page sizes defined in CSS instead of API page size fields.",
                        "default": false
                    },
                    "printBackground": {
                        "title": "Print background",
                        "type": "boolean",
                        "description": "Include background images and colors from the page.",
                        "default": false
                    },
                    "omitBackground": {
                        "title": "Omit white background",
                        "type": "boolean",
                        "description": "Hide Chromium's default white background for transparent output where supported.",
                        "default": false
                    },
                    "emulatedMediaType": {
                        "title": "Emulated media type",
                        "enum": [
                            "print",
                            "screen"
                        ],
                        "type": "string",
                        "description": "Optional CSS media type to emulate.",
                        "default": "print"
                    },
                    "emulatedMediaFeatures": {
                        "title": "Emulated media features JSON",
                        "type": "string",
                        "description": "Optional JSON array like [{\"name\":\"prefers-color-scheme\",\"value\":\"dark\"}]."
                    },
                    "waitDelay": {
                        "title": "Wait delay",
                        "type": "string",
                        "description": "Optional fixed wait like 5s before rendering."
                    },
                    "waitForExpression": {
                        "title": "Wait for expression",
                        "type": "string",
                        "description": "Optional JavaScript expression that must evaluate true before rendering."
                    },
                    "waitForSelector": {
                        "title": "Wait for selector",
                        "type": "string",
                        "description": "Optional CSS selector that must appear before rendering."
                    },
                    "cookies": {
                        "title": "Cookies JSON",
                        "type": "string",
                        "description": "Optional JSON array of cookie objects for authenticated pages."
                    },
                    "extraHttpHeaders": {
                        "title": "Extra HTTP headers JSON",
                        "type": "string",
                        "description": "Optional JSON object of request headers, including scoped values with ;scope=regex if needed."
                    },
                    "userAgent": {
                        "title": "User agent",
                        "type": "string",
                        "description": "Optional custom User-Agent string."
                    },
                    "failOnHttpStatusCodes": {
                        "title": "Fail on main-page status codes JSON",
                        "type": "string",
                        "description": "Optional JSON array like [499,599] to fail on matching main page responses."
                    },
                    "failOnResourceHttpStatusCodes": {
                        "title": "Fail on resource status codes JSON",
                        "type": "string",
                        "description": "Optional JSON array like [499,599] to fail when page resources return matching codes."
                    },
                    "ignoreResourceHttpStatusDomains": {
                        "title": "Ignore resource domains JSON",
                        "type": "string",
                        "description": "Optional JSON array of hostnames excluded from resource status code checks."
                    },
                    "skipNetworkIdleEvent": {
                        "title": "Skip network idle event",
                        "type": "boolean",
                        "description": "Leave enabled to avoid waiting for zero open connections for 500ms.",
                        "default": true
                    },
                    "skipNetworkAlmostIdleEvent": {
                        "title": "Skip network almost-idle event",
                        "type": "boolean",
                        "description": "Leave enabled to avoid waiting for two or fewer open connections for 500ms.",
                        "default": true
                    },
                    "failOnResourceLoadingFailed": {
                        "title": "Fail on resource loading failed",
                        "type": "boolean",
                        "description": "Fail the conversion if images, CSS, or scripts hit network loading errors.",
                        "default": false
                    },
                    "failOnConsoleExceptions": {
                        "title": "Fail on console exceptions",
                        "type": "boolean",
                        "description": "Fail the conversion when Chromium console exceptions occur.",
                        "default": false
                    },
                    "headerHtml": {
                        "title": "Header HTML",
                        "type": "string",
                        "description": "Optional full HTML document used as header.html."
                    },
                    "footerHtml": {
                        "title": "Footer HTML",
                        "type": "string",
                        "description": "Optional full HTML document used as footer.html."
                    },
                    "generateDocumentOutline": {
                        "title": "Generate document outline",
                        "type": "boolean",
                        "description": "Embed PDF bookmarks based on heading tags.",
                        "default": false
                    },
                    "metadata": {
                        "title": "PDF metadata JSON",
                        "type": "string",
                        "description": "Optional XMP metadata JSON object, for example {\"Title\":\"My PDF\",\"Author\":\"Mark\"}."
                    },
                    "embeds": {
                        "title": "Embeds JSON",
                        "type": "string",
                        "description": "Optional JSON array of attachment objects like [{\"url\":\"https://.../invoice.xml\",\"fileName\":\"invoice.xml\",\"mimeType\":\"text/xml\",\"relationship\":\"Alternative\"}]."
                    },
                    "flatten": {
                        "title": "Flatten form fields",
                        "type": "boolean",
                        "description": "Convert interactive form fields into static page content.",
                        "default": false
                    },
                    "nativePageRanges": {
                        "title": "Native page ranges",
                        "type": "string",
                        "description": "Optional Chromium print ranges like 1-3,5,8-10."
                    },
                    "splitMode": {
                        "title": "Split mode",
                        "enum": [
                            "intervals",
                            "pages"
                        ],
                        "type": "string",
                        "description": "Optional post-processing split mode."
                    },
                    "splitSpan": {
                        "title": "Split span",
                        "type": "string",
                        "description": "Split chunk size or explicit page ranges, depending on splitMode."
                    },
                    "splitUnify": {
                        "title": "Split unify",
                        "type": "boolean",
                        "description": "When splitMode is pages, return one PDF instead of separate files per page range.",
                        "default": false
                    },
                    "watermarkSource": {
                        "title": "Watermark source",
                        "enum": [
                            "text",
                            "image",
                            "pdf"
                        ],
                        "type": "string",
                        "description": "Optional watermark source type."
                    },
                    "watermarkExpression": {
                        "title": "Watermark text or expression",
                        "type": "string",
                        "description": "Watermark text when watermarkSource is text. For image/pdf sources, provide watermarkFileUrl instead."
                    },
                    "watermarkPages": {
                        "title": "Watermark pages",
                        "type": "string",
                        "description": "Optional page ranges to watermark, like 1-3 or 5."
                    },
                    "watermarkOptions": {
                        "title": "Watermark options JSON",
                        "type": "string",
                        "description": "Optional JSON object for watermark options like opacity, color, rotation, font, points, scale, or offset."
                    },
                    "watermarkFileUrl": {
                        "title": "Watermark file URL",
                        "type": "string",
                        "description": "Required when watermarkSource is image or pdf. Public URL of the watermark asset."
                    },
                    "watermarkFileName": {
                        "title": "Watermark file name",
                        "type": "string",
                        "description": "Optional filename override for the uploaded watermark asset."
                    },
                    "stampSource": {
                        "title": "Stamp source",
                        "enum": [
                            "text",
                            "image",
                            "pdf"
                        ],
                        "type": "string",
                        "description": "Optional stamp source type."
                    },
                    "stampExpression": {
                        "title": "Stamp text or expression",
                        "type": "string",
                        "description": "Stamp text when stampSource is text. For image/pdf sources, provide stampFileUrl instead."
                    },
                    "stampPages": {
                        "title": "Stamp pages",
                        "type": "string",
                        "description": "Optional page ranges to stamp, like 1-3 or 5."
                    },
                    "stampOptions": {
                        "title": "Stamp options JSON",
                        "type": "string",
                        "description": "Optional JSON object for stamp options like opacity, color, rotation, font, points, scale, or offset."
                    },
                    "stampFileUrl": {
                        "title": "Stamp file URL",
                        "type": "string",
                        "description": "Required when stampSource is image or pdf. Public URL of the stamp asset."
                    },
                    "stampFileName": {
                        "title": "Stamp file name",
                        "type": "string",
                        "description": "Optional filename override for the uploaded stamp asset."
                    },
                    "rotateAngle": {
                        "title": "Rotate angle",
                        "enum": [
                            "90",
                            "180",
                            "270"
                        ],
                        "type": "string",
                        "description": "Optional rotation angle applied during PDF post-processing."
                    },
                    "rotatePages": {
                        "title": "Rotate pages",
                        "type": "string",
                        "description": "Optional page ranges to rotate, like 1-2 or 5."
                    },
                    "generateTaggedPdf": {
                        "title": "Generate tagged PDF",
                        "type": "boolean",
                        "description": "Embed Chromium logical structure tags for accessibility.",
                        "default": false
                    },
                    "pdfa": {
                        "title": "PDF/A mode",
                        "enum": [
                            "PDF/A-1b",
                            "PDF/A-2b",
                            "PDF/A-3b"
                        ],
                        "type": "string",
                        "description": "Optional archival PDF/A conversion mode."
                    },
                    "pdfua": {
                        "title": "PDF/UA",
                        "type": "boolean",
                        "description": "Enable PDF/UA accessibility post-processing.",
                        "default": false
                    },
                    "userPassword": {
                        "title": "User password",
                        "type": "string",
                        "description": "Optional password required to open the PDF."
                    },
                    "ownerPassword": {
                        "title": "Owner password",
                        "type": "string",
                        "description": "Optional password used to control PDF editing and permissions."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
