# Tanod Docs HTML to PDF

> Tanod Docs HTML to PDF is a paid API for AI agents from docs.tanod.dev, paid per call via x402, $0.0045/call, status unknown (last checked 2026-10-13).

Converts a public web page URL to a PDF file, with configurable paper size, orientation, margins, scale, and background rendering.

## Facts

- Endpoint: POST https://docs.tanod.dev/v1/pdf/html-to-pdf?utm_source=zero.xyz
- Price: $0.0045/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tanod-docs-html-to-pdf-a0b6c377
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dQAuvOlQ1fHfBqSLYZFsb

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 tanod-docs-html-to-pdf-a0b6c377 -d '<json body>'
```

Example prompt: Can you convert https://en.wikipedia.org/wiki/PDF to a PDF for me — use A4 paper in portrait orientation, with 15mm margins on all sides, and give me a download link rather than the raw base64?

## When to prefer this

Choose this endpoint when you need to convert a live, publicly accessible web page or HTML URL into a PDF with precise control over paper size, orientation, margins, scale, and background rendering. It is ideal for archiving articles, generating printable reports from web dashboards, or exporting invoices and receipts from public URLs. Prefer the URL output mode when the PDF is large to avoid bloating the context window with base64 data.

## Known failure modes

- URL is not publicly accessible (private, behind auth, or firewall) — conversion may fail or produce empty/incomplete output
- URL returns non-HTML content (e.g. raw binary) — output PDF may be malformed
- wait_ms too low for JavaScript-heavy pages — charts or dynamic content may not render
- Page requires authentication — rendered PDF will show login page instead of content
- Invalid or unreachable URL — 4xx/5xx error response
- Scale or margin values out of allowed range — validation error

## How this service works

Documents: DOCX template fill, Office to PDF, any file to Markdown, PDF to Word, OCR, PDF pipeline.

## Output

Returns a JSON object containing the PDF as either a base64-encoded string (inline) or a temporary download URL valid for 24 hours. Also includes metadata: file name, byte size, page count, paper size, landscape flag, content type, and a SHA256 hash. The response also echoes the source URL and operation name.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "maxLength": 2048,
   "minLength": 1,
   "description": "Public http(s) URL of the page to print."
  },
  "paper": {
   "enum": [
    "a4",
    "letter",
    "legal",
    "a3",
    "a5",
    "tabloid"
   ],
   "type": "string",
   "default": "a4",
   "description": "Paper size: a4 (default), letter, legal, a3, a5 or tabloid."
  },
  "scale": {
   "type": "number",
   "default": 1,
   "maximum": 2,
   "minimum": 0.1,
   "description": "Print scale of the page content (0.1-2.0, default 1.0)."
  },
  "output": {
   "enum": [
    "base64",
    "url"
   ],
   "type": "string",
   "default": "base64",
   "description": "base64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window."
  },
  "wait_ms": {
   "type": "integer",
   "default": 500,
   "maximum": 5000,
   "minimum": 0,
   "description": "Extra settle time after the load event."
  },
  "landscape": {
   "type": "boolean",
   "default": false,
   "description": "Landscape orientation (default false: portrait)."
  },
  "margin_mm": {
   "type": "object",
   "properties": {
    "top": {
     "type": "number",
     "default": 10,
     "maximum": 50,
     "minimum": 0
    },
    "left": {
     "type": "number",
     "default": 10,
     "maximum": 50,
     "minimum": 0
    },
    "right": {
     "type": "number",
     "default": 10,
     "maximum": 50,
     "minimum": 0
    },
    "bottom": {
     "type": "number",
     "default": 10,
     "maximum": 50,
     "minimum": 0
    }
   },
   "description": "Margins in mm (0-50 each, default 10).",
   "additionalProperties": false
  },
  "print_background": {
   "type": "boolean",
   "default": true,
   "description": "Print background colours and images (default true)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com",
  "file": {
   "name": "page.pdf",
   "bytes": 27621,
   "pages": 1,
   "data_base64": "JVBERi0xLjQKJdPr... (trimmed: 36,828 base64 characters in the reply)",
   "content_type": "application/pdf"
  },
  "pages": 1,
  "paper": "a4",
  "landscape": false,
  "operation": "html-to-pdf",
  "output_bytes": 27621,
  "untrusted_content": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tanod-docs-html-to-pdf-a0b6c377/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from docs.tanod.dev](https://www.zero.xyz/host/docs.tanod.dev/llms.txt)
