Prompt
self-hosted PDF API
Latest observation
Oct 12, 2026
OpenAI APIWeb search: off
If you want a self-hosted PDF API, there are a few good options depending on what you need:
Common self-hosted PDF API choices
1. Gotenberg
- Best for: HTML/CSS/JS to PDF, Office docs to PDF
- Features: REST API, Docker-based, Chromium rendering
- Use cases: Generate invoices, reports, web pages as PDFs
- Repo: https://github.com/gotenberg/gotenberg
2. Apache PDFBox
- Best for: Java-based PDF creation/manipulation
- Features: Create, edit, extract text/images, merge, split
- Use cases: Backend services already using Java
- Note: Not really an API server by itself; you build one around it
3. LibreOffice headless
- Best for: Converting DOCX/XLSX/PPTX to PDF
- Features: Can be run in containers and exposed via your own API
- Use cases: Document conversion pipelines
4. Puppeteer / Playwright-based service
- Best for: Rendering HTML to PDF with browser fidelity
- Features: Full browser rendering, highly accurate output
- Use cases: Complex layouts, dashboards, invoices
5. PDFcpu
- Best for: Go-based PDF processing
- Features: Merge, split, validate, optimize, watermark, rotate
- Use cases: Lightweight self-hosted PDF operations
If you want an actual ready-made API service
The most practical one is usually:
Gotenberg
- Easy to run in Docker
- Exposes HTTP endpoints
- Good for HTML-to-PDF and office document conversion
Example:
docker run --rm -p 3000:3000 gotenberg/gotenberg:latest
Then you can POST HTML or files to its endpoints.
If you want, I can help you with one of these:
- Pick the best self-hosted PDF API for your use case
- Show a Docker Compose setup
- Write example API calls
- Compare Gotenberg vs LibreOffice vs Puppeteer
If you tell me what you need PDF generation for, I’ll recommend the best option.