wkhtmltopdf vs Gotenberg: When a PDF API makes sense
Try Marqius to keep your PDF call. Consider Gotenberg if several apps need a shared service for invoices, Word files or spreadsheets.
Marqius

A shop has one app that makes PDF invoices. A larger team has three apps sending documents, including Word files and spreadsheets. The shop may need to change one program. The larger team may want one place to send all kinds of files.
Why this helps
Marqius helps the first team keep its app working. If the app already starts wkhtmltopdf, install Marqius beside it and change the program path in the app’s PDF library. Keep the existing templates, then compare one invoice before switching. Find the setting for your library
Gotenberg helps the second team share one PDF service. Apps send their files to it and get PDFs back. It uses Chromium for web pages and LibreOffice for Word or Excel files. Choose it when you want that shared service and have a team to run it. If your app currently starts wkhtmltopdf, the app will need to send a request to the service instead. Gotenberg project · Conversion routes
How to choose
- If you want to keep the existing PDF call, try Marqius with the library you already use.
- If you want one service for several apps, try Gotenberg with a real file from each app.
- Before moving your live jobs, save the old PDFs and check that the new ones have the right content, layout and page count.
Make the same invoice both ways
You need Docker and curl 7.71 or newer. Both commands render the same static invoice. The first calls Marqius like a command. The second sends the file to a test service.
1. Set up the sample
mkdir -p marqius-gotenberg-demo
cd marqius-gotenberg-demoThe studio’s Invoice 1001 uses three Marqius products as line items so you can see how they fit together. Marqius wkhtmltopdf keeps your existing PDF call working, Studio is where you design the document, and Relay generates it from a template and data. The sample amounts add up to 120.00 EUR including VAT. Open START-HERE.html after unzipping to run the invoice and check a page break. Download the print demo (ZIP) · Open the invoice PDF
If your team also checks files before they go to press, use the sample from Marqius Engine. It has a finished A4 size, 3 mm of bleed, real CMYK colour patches and a 100 mm reference you can measure at actual size. Open the press test sheet
Unzip the demo and put invoice.html in your test folder. If you're already in the terminal, you can get the same file with one command.
curl -fsSLo invoice.html https://marqius.com/download/wkhtmltopdf-demo/0.12.8/invoice.html.txt2. Make the PDF with Marqius
docker run --rm --network none --mount "type=bind,source=$PWD,target=/data" \
marqius/wkhtmltopdf:0.12.8 --page-size A4 invoice.html invoice-marqius.pdf3. Start the Gotenberg test service
service_id=$(docker run -d --rm -p 127.0.0.1:3100:3000 gotenberg/gotenberg:8-chromium)
curl -fsS --retry 15 --retry-all-errors --retry-delay 1 --max-time 5 http://127.0.0.1:3100/healthThe service listens on your computer only. This smaller image is enough for HTML. Use the full Gotenberg image to test Word or spreadsheet conversion.
4. Send the invoice and get the PDF back
cp invoice.html index.html
curl -fsS --max-time 60 --form 'files=@index.html' --form 'preferCssPageSize=true' \
http://127.0.0.1:3100/forms/chromium/convert/html -o invoice-gotenberg.pdf
ls -lh invoice-marqius.pdf invoice-gotenberg.pdf
docker stop "$service_id"Gotenberg expects index.html as the main file. If your real document has a local stylesheet, add another form part for that file and keep the name used by your HTML. Gotenberg HTML route
Open both PDFs. Check the heading, the 120.00 EUR total and where the table sits on the page. Think about which change your app needs. To try Marqius, change the program path in your existing PDF library. To use Gotenberg, add an HTTP request and handle the response or error. The public scoreboard covers the separate comparison of wkhtmltopdf and Marqius.
Reader questions
Can Gotenberg be installed as the wkhtmltopdf executable?
Gotenberg exposes HTTP endpoints. To switch an app that calls wkhtmltopdf, change the integration to submit an HTTP request and handle a PDF response.