> ## Documentation Index
> Fetch the complete documentation index at: https://pdfbase.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Everything PDF in one API. Generate, edit, extract, and convert — built for developers and AI agents.

## What is PDFBase?

PDFBase is a unified PDF API that handles the entire PDF lifecycle: generation from HTML or templates, editing (merge, split, watermark, compress), extraction (text, tables, OCR), and format conversion — all through a single, consistent API.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/docs/quickstart">
    Generate your first PDF in under 2 minutes
  </Card>

  <Card title="API Reference" icon="code" href="/docs/api-reference/overview">
    Full endpoint documentation with examples
  </Card>

  <Card title="Templates" icon="file-code" href="/docs/guides/templates">
    Build reusable, data-driven PDF templates
  </Card>

  <Card title="CLI" icon="terminal" href="/docs/cli/overview">
    Generate and manage PDFs from your terminal
  </Card>
</CardGroup>

## Why PDFBase?

**You can build PDF generation yourself.** Puppeteer + 2 hours = working prototype. Then you'll spend 2 months making it production-grade: browser pooling, font loading, timeout handling, concurrent request management, storage, retries.

We did that part already. \$50/mo.

### The self-hosting tax

| Concern                     | DIY cost                     | PDFBase                           |
| --------------------------- | ---------------------------- | --------------------------------- |
| Browser pool management     | Weeks of tuning              | Managed                           |
| Font/asset loading failures | Silent bugs, debug hell      | Debug mode with screenshots       |
| Concurrent request handling | Custom queue system          | Built-in rate limiting + batching |
| Storage + signed URLs       | S3 setup + expiry logic      | Automatic, 24h TTL                |
| Chromium version drift      | Rendering breaks silently    | Pinned + documented version       |
| Estimated monthly cost      | \$500-700 (dev time + infra) | \$50-200                          |

### Who it's for

| You                                 | Should you use PDFBase?                               |
| ----------------------------------- | ----------------------------------------------------- |
| Solo dev, 1 template, \<100 PDFs/mo | Probably not. Puppeteer is fine.                      |
| Startup, 2-5 templates, growing     | Yes. Infra tax hits by month 2.                       |
| Agency, many clients                | Yes. Can't maintain N custom systems.                 |
| Enterprise, compliance requirements | Yes. Self-hosted Chromium = security audit nightmare. |
| AI agent builders                   | Yes. Agents need APIs, not libraries.                 |

## Core capabilities

### Generate (Phase 1)

Create PDFs from HTML, URLs, or stored templates with full Chromium rendering. Supports JavaScript execution, web fonts, CSS Grid/Flexbox, and everything a modern browser renders.

### Edit (Phase 2)

Merge multiple PDFs, split pages, add text or image watermarks, and compress file sizes. All operations return a new PDF — originals are never mutated.

### Extract (Phase 3)

Pull text content, structured table data, and OCR scanned documents. AI-powered structured extraction turns invoices and receipts into clean JSON.

### Convert (Phase 2)

Office documents (DOCX, XLSX, PPTX) to PDF. PDF to PNG/JPEG for thumbnails and previews.

## Design principles

1. **One API call = one credit.** No fractional credits, no per-page charges, no failed-request billing.
2. **Stripe-quality DX.** Prefixed IDs, option objects, idempotency keys, typed errors, webhook HMAC signing.
3. **Debug-first.** Every generation can return a screenshot, console output, and failed resource list alongside the PDF.
4. **Agent-native.** MCP server, structured errors, and deterministic outputs make PDFBase a first-class tool for AI agents.
