# x402 AgentUtility HTML-to-PDF Converter

> x402 AgentUtility HTML-to-PDF Converter is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.08/call, status unknown (last checked 2026-10-11).

Renders a live webpage as a PDF document by capturing its fully-rendered state via CloudConvert and returning a downloadable PDF URL with file size.

## Facts

- Endpoint: POST https://x402.agentutility.ai/html-to-pdf?utm_source=zero.xyz
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-agentutility-html-to-pdf-converter-b0dad6b6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ui0WS1ZVGCBodbJ2AFHDs

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-agentutility-html-to-pdf-converter-b0dad6b6 -d '<json body>'
```

Example prompt: Can you convert this webpage to a PDF for me — https://example.com/report — using A4 format, landscape orientation, and wait for all JavaScript to finish loading before capturing it?

## When to prefer this

Choose this endpoint when you need to capture a fully rendered, JavaScript-heavy webpage as a high-quality PDF, especially when precise formatting controls (page format, orientation, margins) matter. It is particularly well-suited for archiving dynamic dashboards, reports, or invoices rendered in the browser. Prefer it over simpler screenshot tools when a structured PDF output with configurable layout is required and you are comfortable with USDC-based x402 micropayments.

## Known failure modes

- Invalid or unreachable URL returns an error with no PDF generated
- Page fails to render within timeout causing an incomplete capture
- Unsupported page_format or orientation value returns a validation error
- JavaScript-heavy pages may render incompletely if wait_until condition is not set appropriately
- Payment failure via x402 protocol prevents the request from being processed

## How this service works

Render a live webpage as a PDF document. Send a url plus optional page_format, orientation, margins, and a wait_until condition for JS-heavy pages, and it captures the rendered page through CloudConvert and returns a pdf_url with the file size in bytes. Use it as a URL to PDF converter, webpage-to-PDF capture tool, or website screenshot to PDF generator for archiving or reporting pages.

## Output

Returns a pdf_url pointing to the generated PDF file hosted by CloudConvert, along with the file size in bytes. The PDF reflects the fully rendered state of the page at the time of capture, including JavaScript-rendered content if a wait_until condition was specified.

## 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",
       "description": "URL to render and capture as a PDF. Must be http or https."
      },
      "margin_top": {
       "type": "number",
       "description": "Optional. Top margin in inches, 0-5."
      },
      "wait_until": {
       "type": "string",
       "description": "Optional. Load condition before capture: 'load', 'domcontentloaded', 'networkidle0', or 'networkidle2'."
      },
      "page_format": {
       "type": "string",
       "description": "Optional. Page size, e.g. 'a4', 'letter', 'legal', 'tabloid', 'a0'-'a6'."
      },
      "margin_bottom": {
       "type": "number",
       "description": "Optional. Bottom margin in inches, 0-5."
      },
      "page_orientation": {
       "enum": [
        "portrait",
        "landscape"
       ],
       "type": "string",
       "description": "Optional. 'portrait' or 'landscape'."
      },
      "print_background": {
       "type": "boolean",
       "description": "Optional. Include background graphics. Default false."
      }
     }
    },
    "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",
     "properties": {
      "pdf_url": {
       "type": "string"
      },
      "file_size_bytes": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "pdf_url": "https://...pdf",
  "file_size_bytes": 20350
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-agentutility-html-to-pdf-converter-b0dad6b6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
