DOCX conversion to PDF doesn't keep the font

Hi,

We have documents that have multiple fonts. When converting from DOCX to PDF, one of the fonts(FS Humana) is transformed in Arial. The font is installed on the server. How can we solve this?

Regards,
Ovidiu.

@omarinoiu The problem might occur because the font cannot be found or accessed by Aspose.Words and the missed fonts are substituted. You can implement IWarningCallabck to get a notification when font substitution is performed.
Also, please post the questions related to Aspose.Words in the appropriate support forum. This will guaranty timely response. If it is possible please attach your input document and the problematic font in Aspose.Words forum. We will check the issue and provide you more information.

Even if the font is installed, check that the Windows service or IIS app-pool identity can actually see it; fonts installed only for an interactive user are not visible to service accounts. Also confirm the family name inside the font file exactly matches “FS Humana” and check the font’s embedding permissions (fsType), since a restricted font may still be substituted. A font-substitution warning callback will show whether the library cannot resolve the font or is rejecting it for embedding.

@ethanjohnson
Thank you for sharing your experience and detailed insights. We appreciate the additional information you have provided.

We will look into this further and get back to you with our findings as soon as possible.

Thank you for your patience and cooperation.

Instead of relying exclusively on Windows-installed fonts, configure Aspose.Words to use a dedicated font directory.

For example, place the licensed FS Humana font files in C:\AppFonts\ and grant the IIS application pool or Windows service account read access to that directory.

using Aspose.Words;
using Aspose.Words.Fonts;

FontSettings fontSettings = new FontSettings();

fontSettings.SetFontsSources(new FontSourceBase[]
{
    new SystemFontSource(),
    new FolderFontSource(@"C:\AppFonts", true)
});

Document doc = new Document("input.docx");

doc.FontSettings = fontSettings;

doc.Save("output.pdf");

Hope it helps.

Best regards