Gotenberg
Developer-friendly API to interact with powerful tools like Chromium and LibreOffice for converting numerous document formats (HTML, Markdown, Word, Excel, etc.) into PDF files, and more.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Introduction
Gotenberg is an open-source PDF conversion service. It is deployed as a Docker container and called through an HTTP API (multipart form requests). It bundles Chromium (a headless browser), LibreOffice, and PDF tools such as QPDF, pdfcpu, and ExifTool, so developers can generate and process PDFs without installing and maintaining these complex dependencies in their own applications. The project is released under the MIT License, has more than 12,000 stars on GitHub, and has been pulled from Docker more than 97 million times.
Key Features
Pixel-perfect Chromium rendering
- Convert URLs, HTML templates, and Markdown files to PDF
- Headless Chromium executes JavaScript and loads web fonts, so the output looks the same as in a browser
- Supports dynamic content: rendering can wait until the network is idle, a JavaScript expression evaluates to true, or a specified DOM selector appears, which suits single-page applications (SPAs)
- Network control: inject custom cookies and HTTP headers, and configure how network errors or specific status codes are handled
Automated LibreOffice conversion
- Supports more than 100 document formats, including Word, Excel, and PowerPoint (.docx, .xlsx, .pptx)
- Can extract only a specified page range during conversion
- Can output files that comply with the PDF/A archival standard directly
PDF post-processing engine
- Access QPDF, pdfcpu, and ExifTool through a single unified API
- Merge multiple PDFs, split them by page range or interval, and rotate pages
- Flatten form fields and annotations, and add watermarks or stamps
- Encrypt with a password and permissions
- Embed attachments and generate Factur-X / ZUGFeRD electronic invoices
- Read and write metadata and bookmarks
Zero-relay processing pipeline
- Pull source files directly from cloud storage such as S3, MinIO, and GCS through presigned GET URLs
- Automatically upload the generated PDFs back to storage through presigned PUT URLs
- Send structured JSON webhook event notifications when processing completes or fails
- Files never pass through your own application server, which saves bandwidth; your service only handles orchestration, while Gotenberg does the heavy conversion work
Target Users
- Backend developers who need to generate PDFs such as invoices, reports, and contracts in business systems
- Teams that want to run document conversion as an independent microservice
- Companies that need to convert Office documents in bulk to PDF or PDF/A archives
Deployment
Two commands are all it takes to get started:
# 启动容器
docker run --rm -p "3000:3000" gotenberg/gotenberg:8
# 将 URL 转换为 PDF
curl --request POST http://localhost:3000/forms/chromium/convert/url \
--form url=https://my.url \
-o my.pdf
Example of converting an Office document:
curl --request POST http://localhost:3000/forms/libreoffice/convert \
--form [email protected] \
--form nativePageRanges=1-5 \
--form pdfa=PDF/A-1b \
-o my.pdf
Technical Requirements
- Requires Docker or another compatible container runtime
- Supported architectures: amd64, arm64, armhf, i386, ppc64le
- The service listens on port 3000 by default
Notable Points
- A stateless API service that is easy to scale horizontally and can be integrated with any programming language
- An official PHP SDK is provided, and the community lists clients for other languages in the Awesome Gotenberg list
- The official documentation includes complete route descriptions and a configuration reference; there are dedicated upgrade notes for moving from 7.x to 8.x
- Supported by the Docker-Sponsored Open Source program and the JetBrains open-source program
Discover more
Atsumeru
Manga/comic/light novel media server with clients for Windows, Linux, macOS and Android.
DocKing
Document management service/microservice that handles templates and renders them in PDF format, all in one place.
Komga
Media server for comics/mangas/BDs with API and OPDS support, a modern web interface for exploring your libraries, as well as a web reader.
BentoPDF
The Privacy First PDF Toolkit
BookLogr
Manage your personal book library with ease.
Docspell
Auto-tagging document organizer and archive.