Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

[Bug]: Incorrect DOCX to PDF Conversion (works on Gotenberg)

Open thepebbler opened this issue 4 months ago • 2 comments

Installation Method

Docker fat

The Problem

I am still finding I'm having to use Gotenberg (8.x) to convert word documents to PDF (using their 8.x container image) using their libreoffice API option.

Effectively some fonts/formatting are different and not translating through, Gotenberg is 99.9% faithful to the original docx (across a range of documents).

Version of Stirling-PDF

1.1.1

Last Working Version of Stirling-PDF

No response

Page Where the Problem Occurred

http://localhost:8080/file-to-pdf

Docker Configuration


Relevant Log Output


Additional Information

I've attached an example source docx, and stirling / gotenberg conversions.

BOB-33252001_v3a - Saturn - Mechanical Finish Specification (signed).docx

BOB-33252001_v3a - Saturn - Mechanical Finish Specification (signed) (Gotenberg).pdf

BOB-33252001_v3a - Saturn - Mechanical Finish Specification (signed) (StirlingPDF).pdf

I am using the libreoffice conversion via the Gotenberg API with the following options: exportFormFields => false allowDuplicateFieldNames => true

Using far longer/complex word documents Gotenberg is pretty much flawless, using Stirling the fonts/rendering are out enough to increase the document pages by around 1/3rd..

I can carry on using Gotenberg, but hoping to have a one stop solution with Stirling!

Browsers Affected

No response

No Duplicate of the Issue

  • [x] I have verified that there are no existing issues raised related to my problem.

thepebbler avatar Aug 07 '25 14:08 thepebbler

Stirling-PDF uses LibreOffice and Unoconv for DOCX to PDF conversion, and the Docker fat image includes these tools out of the box. However, font and formatting fidelity issues are a known limitation—LibreOffice determines the output based on the fonts available inside the container, and Stirling-PDF does not expose any settings to control this directly. This means that if the required fonts aren't present in the Docker image, the output may differ from the original or from what you see with Gotenberg, which may bundle a more complete set of fonts or different LibreOffice settings (sourcedocs).

To improve fidelity, you can try installing additional fonts in your Docker container or adjust the LANGS environment variable to ensure the necessary fonts for your documents are present. If you need very high fidelity, you may need to customize the Docker image to include the exact fonts used in your DOCX files. Upgrading LibreOffice can sometimes help, but this is not always possible with the prebuilt Docker images (sourcedocs).

Stirling-PDF does not currently support advanced LibreOffice conversion options like those exposed in the Gotenberg API. If you need to match Gotenberg's output, you may need to continue using it for now or experiment with customizing your Stirling-PDF Docker setup to better match your font and locale requirements (source).

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Aug 07 '25 14:08 dosubot[bot]

Good callouts ill investigate

Frooodle avatar Aug 07 '25 15:08 Frooodle