← Back
Show Markdown
Download Markdown
Gotenberg is a Docker-powered print and conversion API. It supports various document formats like HTML, Markdown, Word, Excel, and more, converting them into PDF files.
To convert a document, you typically send a multipart/form-data
POST request to the appropriate endpoint. Here's an example using curl
to convert an HTML file to PDF:
curl -X POST \
-F "files=@index.html" \
http://localhost:3000/forms/chromium/convert/html -o output.pdf
Replace index.html
with the path to your HTML file and output.pdf
with the desired output filename.
For converting a URL to PDF:
curl -X POST \
-F "url=https://example.com" \
http://localhost:3000/forms/chromium/convert/url -o output.pdf
Gotenberg is configured primarily through environment variables. Key configuration options include:
API_PORT
: The port the Gotenberg API listens on (default: 3000).CHROMIUM_BIN_PATH
: Path to the Chromium binary.LIBREOFFICE_BIN_PATH
: Path to the LibreOffice binary.UNOCONVERTER_BIN_PATH
: Path to the unoconverter script.PDFTK_BIN_PATH
: Path to the PDFtk binary.QPDF_BIN_PATH
: Path to the QPDF binary.EXIFTOOL_BIN_PATH
: Path to the ExifTool binary.Refer to the Makefile for a comprehensive list of available configuration options and their corresponding flags.
Gotenberg relies on several Go modules, which are managed using go mod
. Key dependencies include:
github.com/labstack/echo/v4
: For the HTTP server.github.com/chromedp/chromedp
: For interacting with Chromium.github.com/barasher/go-exiftool
: For reading and writing PDF metadata.github.com/alexliesenfeld/health
: For health checks.github.com/spf13/pflag
: For command-line flag parsing.The go.mod
file lists all dependencies:
module github.com/gotenberg/gotenberg/v8
go 1.24.0
require (
github.com/alexliesenfeld/health v0.8.1
github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3 // indirect
github.com/barasher/go-exiftool v1.10.0
github.com/chromedp/cdproto v0.0.0-20250416210000-d7e4d624041a
github.com/chromedp/chromedp v0.13.7
github.com/google/uuid v1.6.0
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/labstack/echo/v4 v4.13.4
github.com/labstack/gommon v0.4.2
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/microcosm-cc/bluemonday v1.0.27
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/prometheus/client_golang v1.22.0
github.com/russross/blackfriday/v2 v2.1.0
github.com/spf13/pflag v1.0.6
github.com/ulikunitz/xz v0.5.12 // indirect
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/net v0.41.0
golang.org/x/sync v0.15.0
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0
golang.org/x/text v0.26.0
)