Gotenberg: Free Open Source PDF & Document Conversion API

When it comes to converting documents to PDF in a self-hosted and developer-friendly way, Gotenberg stands out as a powerful and free open-source solution.
Whether you're working with HTML, Markdown, or Office documents, Gotenberg provides a seamless API to convert files to PDF at scale, with robust options and performance built-in. In this article, we’ll walk through what Gotenberg is, its main features, and why it might be the best choice for your PDF generation needs.
Watch our platform overview on our YouTube channel
Website URL to PDF
One of Gotenberg’s most useful features is its ability to convert a public website URL directly into a PDF. By sending a simple HTTP request to the API with the URL you want to convert, Gotenberg uses Chromium headless to render the page and generate a high-fidelity PDF.
This is ideal for use cases like:
- Archiving web content
- Generating printable invoices or reports from dashboards
- Turning blog posts or product pages into downloadable PDFs
Developers can specify additional options such as page size, margins, and media emulation (like screen vs print view), making it a versatile tool for all sorts of HTML-to-PDF needs.
Options and Parameters
Gotenberg offers a wide array of parameters to fine-tune the PDF output:
- Page size & margins: Set standard sizes (A4, Letter, etc.) and custom margins for layout control.
- Scale: Adjust zoom/scaling for rendering pages.
- Media type: Emulate print or screen rendering modes.
- Wait for selectors: Ensure that dynamic content (e.g., JavaScript-generated charts) finishes loading before rendering.
- Header/Footer templates: Add dynamic headers or footers with page numbers, titles, and more.
These parameters provide developers with granular control over PDF generation, allowing for tailored and professional output in any environment.
Markdown to PDF
Need to convert Markdown files into beautifully formatted PDFs? Gotenberg supports this out of the box. Simply send your .md
file to the API, and it will render it using a built-in Markdown renderer, then pass it to Chromium for PDF conversion.
This is particularly useful for:
- Developer documentation
- Technical reports
- README or changelogs
You can even apply custom stylesheets to control the visual appearance, allowing you to brand or format the output exactly as you like.
Office Docs to PDF
Gotenberg isn’t limited to web formats — it also supports Office document conversion via LibreOffice integration. This includes:
.doc
,.docx
.xls
,.xlsx
.ppt
,.pptx
.odt
,.ods
,.odp
You simply upload the files through the API, and Gotenberg converts them to PDF with impressive accuracy. This makes it an excellent alternative to commercial converters like Adobe or cloud-based services like Google Docs — with full control over your data and deployments.
Documentation
Gotenberg’s official documentation is clear, well-organized, and developer-centric. It provides:
- A quick-start guide for Docker setup
- API reference with all available endpoints
- Parameter and payload explanations
- Examples of usage with curl, JavaScript, and other languages
- Guides on using the modules (Chromium, LibreOffice, Webhook, etc.)
Whether you’re integrating Gotenberg into a microservice architecture or using it as a standalone PDF service, the documentation has everything you need to get started quickly.
Conclusion
Gotenberg is a powerful, flexible, and fully open-source API for document and PDF conversion. It combines the rendering power of Chromium with the versatility of LibreOffice, all wrapped in a simple HTTP API that’s easy to integrate into any backend.
With support for:
- Web pages and HTML
- Markdown files
- Office documents
- Fine-tuned PDF rendering parameters
…Gotenberg empowers developers to automate document generation at scale without relying on proprietary or cloud-based services. Whether you're building a report engine, an internal dashboard, or a customer-facing feature — Gotenberg is definitely worth considering.