Hi @willy.koch,
Thanks for reaching out.
There’s no special font code behind the online app. It calls the same Converter API you use. The difference is which fonts are installed on the machine doing the conversion. A bare .NET container has almost none, so every slide font falls back to DejaVu Sans. That font is noticeably wider, so text rewraps and the layout breaks. Plain PDF and PDF/A are affected the same way.
You can check this quickly by converting one of the problematic files to plain PDF (no PdfFormat set) in your container. If it’s broken too, it’s the fonts. If only the PDF/A output breaks, please share that file with us.
First, get basic fonts into the image. This is what we tested on mcr.microsoft.com/dotnet/aspnet:8.0 (Debian):
RUN sed -i 's/^Components: main$/Components: main contrib/' /etc/apt/sources.list.d/debian.sources \
&& echo "ttf-mscorefonts-installer msttcorefonts/accept-mscorefonts-eula select true" | debconf-set-selections \
&& apt-get update \
&& apt-get install -y fontconfig ttf-mscorefonts-installer fonts-crosextra-carlito fonts-crosextra-caladea \
&& fc-cache -f \
&& rm -rf /var/lib/apt/lists/*
That covers Arial, Times New Roman, Verdana and the like, but not Calibri, Calibri Light or Cambria, which most PowerPoint templates use. For those there are two options.
Option 1: the original fonts. If you have a license for the fonts your decks use, copy them into a folder in the image and point the converter at it. This gave us output identical to the Windows conversion:
var settings = new ConverterSettings();
settings.FontDirectories.Add("/opt/fonts");
using (var converter = new Converter("input.pptx", () => settings))
{
var options = new PdfConvertOptions();
options.PdfOptions.PdfFormat = PdfFormats.PdfA_2B;
converter.Convert("output.pdf", options);
}
Option 2: metric-compatible replacements. Carlito has the same character widths as Calibri, and Caladea is the equivalent for Cambria. Installing them isn’t enough on its own; you need to map the fonts explicitly. Note that “Calibri Light” (the default heading font) is a separate family and needs its own entry:
Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PresentationLoadOptions
{
DefaultFont = "Arial",
FontSubstitutes = new List<FontSubstitute>
{
FontSubstitute.Create("Calibri", "Carlito"),
FontSubstitute.Create("Calibri Light", "Carlito"),
FontSubstitute.Create("Cambria", "Caladea")
}
};
using (var converter = new Converter("input.pptx", getLoadOptions))
{
var options = new PdfConvertOptions();
options.PdfOptions.PdfFormat = PdfFormats.PdfA_2B;
converter.Convert("output.pdf", options);
}
With Carlito, line breaks matched the Windows output exactly in our test. Caladea came close to Cambria, but a few lines broke differently. Don’t combine the two options for the same font: a substitute is applied even when the original font is available.
To see which fonts a deck uses, open it in PowerPoint and go to Home → Replace → Replace Fonts. The font options are described in Load Presentation document with options.
If the layout still breaks after that, please attach a sample PPTX and tell us the PDF/A level, your base image and the GroupDocs.Conversion version. We’ll reproduce it on our side.