Docx to Pdf convertation exception

An exception occurs when attempting to convert DOCX to PDF:
System.InvalidOperationException : Cannot get a matching glyph typeface for font 'Calibri'.

HarfBuzzSharp.NativeAssets.Linux - 8.3.1.1
GemBox.Document - 2025.9.108
net 8.0

Code:

    ComponentInfo.SetLicense("FREE-LIMITED-KEY");
    ComponentInfo.FreeLimitReached += (sender, e) => e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial;
    var docxStream = File.OpenRead(@"./Resources/TestConvertation.docx");
    docxStream.Position = 0;
    var model = DocumentModel.Load(docxStream, new DocxLoadOptions());

    var result = new MemoryStream();
    model.Save(result, new PdfSaveOptions { ConformanceLevel = PdfConformanceLevel.PdfA1b });

Conversion works without errors on Ubuntu 24.04, but fails when running in Docker. What could be the problem?

Thanks

Hi,

The problem occurs because no font files are installed on your Docker image.

Please check our Docker example:

Or our Fonts example:

Does this solve your issue?

Regards,
Mario

1 Like