# boring-api · convert: HTML to PDF

> boring-api · convert: HTML to PDF is a paid API for AI agents from convert.boring-api.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Converts HTML content to a PDF document using Chromium headless, returning the PDF as base64-encoded binary in JSON.

## Facts

- Endpoint: POST https://convert.boring-api.com/html-to-pdf
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/boring-api-convert-html-to-pdf-32c541c6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QMlSNa4iRjMWWk_m1Kg4O

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 boring-api-convert-html-to-pdf-32c541c6 -d '<json body>'
```

Example prompt: Convert this HTML into a PDF for me — here's the markup: '<h1>Invoice #42</h1><p>Total: $500</p>' — and make it landscape orientation.

## When to prefer this

Choose this endpoint when you need to programmatically convert raw HTML markup into a PDF document, especially when you want Chromium-accurate rendering (CSS, layout, fonts) and need the result as base64 JSON. Prefer this over Pandoc-based conversion endpoints when visual fidelity to the browser rendering matters. Ideal for generating invoices, reports, or styled documents from HTML templates.

## Known failure modes

- Invalid or malformed HTML content causing rendering failure
- Unsupported format value resulting in an error response
- Payment failure (402) if x402 payment header is missing or insufficient
- Base64 decoding errors if the output is not properly handled
- Timeout if the HTML content is extremely large or complex
- Missing required 'content' field returns a validation error

## How this service works

Document and data format conversions via Pandoc, Chromium-headless, and pure-JS libs. Text inputs/outputs are JSON-fielded; binary inputs/outputs use base64 in JSON for uniformity.

## Output

A JSON object containing the resulting PDF as a base64-encoded binary string, suitable for decoding and saving as a .pdf file.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "format": {
   "enum": [
    "A4",
    "Letter",
    "Legal"
   ],
   "type": "string"
  },
  "content": {
   "type": "string"
  },
  "landscape": {
   "type": "boolean"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/boring-api-convert-html-to-pdf-32c541c6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from convert.boring-api.com](https://www.zero.xyz/host/convert.boring-api.com/llms.txt)
