# 402utils HTML/URL to PDF Renderer

> 402utils HTML/URL to PDF Renderer is a paid API for AI agents from 402utils.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Converts inline HTML or a public web URL into a pixel-perfect PDF using headless Chrome, returning raw PDF bytes

## Facts

- Endpoint: POST https://402utils.com/v1/pdf?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-html-url-to-pdf-renderer-155d9d98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C1XCfoTJVxlrX2gkjaISK

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 402utils-html-url-to-pdf-renderer-155d9d98 -d '<json body>'
```

Example prompt: Convert this HTML invoice into an A4 PDF with 10mm margins on all sides, landscape orientation, and make sure background colors are included: <html>...</html>

## When to prefer this

Choose this endpoint when you need server-side, headless-Chrome-quality PDF rendering without running your own browser infrastructure. Ideal for generating invoices, receipts, reports, and tickets from HTML templates or snapshotting live web pages as PDFs. Preferred over client-side PDF libraries when pixel-perfect CSS fidelity and background graphics matter, and over full browser automation when you just need a single-document render at $0.01 per call.

## Known failure modes

- HTML exceeds 1 MB limit — request rejected
- URL is not publicly accessible or returns non-200 — rendering fails
- Invalid paper format enum value — validation error
- Margin values outside 0–100mm range — validation error
- Scale factor outside 0.5–2.0 range — validation error
- Both url and html provided simultaneously — mutually exclusive fields error
- JS-heavy page not fully rendered — use waitUntil: networkidle instead of load
- Payment not processed via x402 — 402 Payment Required response

## How this service works

Render HTML or a public web page into a pixel-perfect PDF using a headless Chrome browser. Send inline `html` (invoices, receipts, reports, tickets) or a `url` to snapshot; control paper size, orientation, margins, background graphics and scale. Returns the raw application/pdf bytes — no signup, no browser to run, pay per document.

## Output

Raw application/pdf binary bytes representing the rendered document — ready to save, stream, or attach to an email. No wrapper JSON, just the PDF file content.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "Public http(s) URL to render. Mutually exclusive with html."
  },
  "html": {
   "type": "string",
   "description": "Inline HTML document to render (max 1 MB). Mutually exclusive with url."
  },
  "scale": {
   "type": "number",
   "maximum": 2,
   "minimum": 0.5,
   "description": "Render scale factor."
  },
  "format": {
   "enum": [
    "A4",
    "Letter",
    "Legal"
   ],
   "type": "string",
   "default": "A4",
   "description": "Paper size."
  },
  "margin": {
   "type": "object",
   "properties": {
    "top": {
     "type": "number"
    },
    "left": {
     "type": "number"
    },
    "right": {
     "type": "number"
    },
    "bottom": {
     "type": "number"
    }
   },
   "description": "Page margins in millimetres (0–100 each)."
  },
  "landscape": {
   "type": "boolean",
   "default": false,
   "description": "Landscape orientation."
  },
  "waitUntil": {
   "enum": [
    "load",
    "networkidle"
   ],
   "type": "string",
   "default": "load",
   "description": "When to consider the page ready. Use 'networkidle' for JS-heavy pages."
  },
  "printBackground": {
   "type": "boolean",
   "default": true,
   "description": "Print CSS background colours and images."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": "<binary application/pdf stream>"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-html-url-to-pdf-renderer-155d9d98/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
