# HTML to PDF / URL to PDF Converter

> HTML to PDF / URL to PDF Converter is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.08/call, status unknown (last checked 2026-09-14).

Converts a URL, raw HTML, or webpage to a PDF with configurable page size, orientation, margins, and JavaScript rendering via CloudConvert capture-website.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/html-to-pdf
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-ebe36f2f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DK_d2Muq849lSB6OtyJIM

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-ebe36f2f -d '<json body>'
```

Example prompt: Convert https://example.com/report to a PDF for me — use A4 paper size, landscape orientation, and wait for the page's JavaScript to finish loading before capturing.

## When to prefer this

Choose this endpoint when you need to render a live webpage (including JavaScript-heavy single-page apps) or raw HTML into a PDF with precise control over layout (page size, orientation, margins). It is preferable over simpler HTML-to-PDF tools when JS rendering is required, and over headless browser setups when a managed API is desired. Backed by CloudConvert capture-website for high-fidelity output.

## Known failure modes

- Invalid or unreachable URL returns an error response
- Malformed HTML may produce a blank or broken PDF
- Timeout if wait conditions are never satisfied by the target page
- Unsupported page size or orientation enum value returns a validation error
- Payment not included or insufficient USDC results in 402 Payment Required

## How this service works

URL to PDF / HTML to PDF / webpage screenshot to PDF. CloudConvert capture-website. Configurable page size, orientation, margins, wait conditions. Renders JS.

## Output

Returns a PDF file (binary) generated from the provided URL or HTML content, rendered with full JavaScript support, respecting the configured page size, orientation, and margin settings.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string"
      },
      "margin_top": {
       "type": "number"
      },
      "wait_until": {
       "type": "string"
      },
      "page_format": {
       "type": "string"
      },
      "margin_bottom": {
       "type": "number"
      },
      "page_orientation": {
       "enum": [
        "portrait",
        "landscape"
       ],
       "type": "string"
      },
      "print_background": {
       "type": "boolean"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-ebe36f2f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
