# Tanod Docs PDF Flatten

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

Flattens PDF annotations and form fields into static page content, removing interactivity and active content like JavaScript.

## Facts

- Endpoint: POST https://docs.tanod.dev/v1/pdf/flatten?utm_source=zero.xyz
- Price: $0.005/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-pdf-flatten-2e421bd8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5m0C7VQtssizB3LF0TXkW

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-pdf-flatten-2e421bd8 -d '<json body>'
```

Example prompt: Can you flatten all the annotations and form fields in this PDF so it becomes a static, non-interactive document — I want all visible elements baked in and any JavaScript removed? Here's the URL: https://example.com/myform.pdf

## When to prefer this

Choose this endpoint when you need to irreversibly bake annotations, form fields, and interactive elements into a PDF's static page content — especially for archival, secure distribution, or sanitization purposes (e.g. removing JavaScript from untrusted PDFs). Prefer this over general PDF conversion endpoints when the goal is specifically flattening interactivity rather than format conversion or text extraction.

## Known failure modes

- PDF URL exceeds 20 MB limit — request rejected
- Base64 input exceeds 10 MB decoded — request rejected
- URL points to a private, internal, or IP-literal host — refused
- Invalid PDF or corrupt file — processing error returned
- Unsupported mode value outside all/screen/print — validation error
- Network timeout fetching remote PDF URL

## How this service works

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

## Output

Returns the flattened PDF either as inline base64 data or a 24-hour download URL (with expiry, size, content type, and SHA256). Also includes metadata: page count, input/output byte sizes, annotation counts before and after flattening, number of dropped widgets, number of appearances drawn, and a report of any active content (e.g. JavaScript) that was removed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "anyOf": [
    {
     "type": "string",
     "maxLength": 2048,
     "minLength": 1
    },
    {
     "type": "null"
    }
   ],
   "default": null,
   "description": "Public http(s) URL of the PDF (at most 20 MB; private, internal and IP-literal hosts are refused); or use pdf_base64."
  },
  "mode": {
   "enum": [
    "all",
    "screen",
    "print"
   ],
   "type": "string",
   "default": "all",
   "description": "all (default): every visible annotation and form field; screen: what a viewer shows; print: what is marked for printing. Annotations the mode does not flatten are removed."
  },
  "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."
  },
  "pdf_base64": {
   "anyOf": [
    {
     "type": "string",
     "maxLength": 13398872,
     "minLength": 1
    },
    {
     "type": "null"
    }
   ],
   "default": null,
   "description": "The PDF as base64 (at most 10 MB decoded per request); or use url."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "file": {
   "name": "flattened.pdf",
   "bytes": 89021,
   "pages": 6,
   "data_base64": "JVBERi0xLjcKJb/3... (trimmed: 118,696 base64 characters in the reply)",
   "content_type": "application/pdf"
  },
  "mode": "all",
  "warnings": [],
  "operation": "flatten",
  "input_bytes": 140815,
  "input_pages": 6,
  "output_bytes": 89021,
  "dropped_widgets": 15,
  "annotations_after": 0,
  "appearances_drawn": 0,
  "untrusted_content": true,
  "annotations_before": 23,
  "flattened_annotations": 8,
  "active_content_removed": {
   "javascript": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tanod-docs-pdf-flatten-2e421bd8/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)
