I am using this example here: Specify Default Fonts|Aspose.Words for .NET and the attached docx file. No matter what I set the ‘DefaultFontName’ to, the output PDF always has Times New Roman. How do I actually set a fallback/default font for when the embedded font in the docx can’t be used?file.docx (382.8 KB)
Using Aspose.Words version 20.7.0.0
We have logged this problem in our issue tracking system as WORDSNET-22672. You will be notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
It is to inform you that we have closed the issue WORDSNET-22672 as ‘Not a Bug’. The FontInfo substitution rule overrides the default font substitution rule. For more detail about font availability and substitution, please read the following article.
You can use following code example to achieve your requirement.
Document doc = new Document(MyDir + "input.docx");
FontSettings fontSettings = new FontSettings();
fontSettings.SubstitutionSettings.FontInfoSubstitution.Enabled = true;
fontSettings.SubstitutionSettings.TableSubstitution.AddSubstitutes("Helvetica Neue Light", new[] { "Arial" });
doc.FontSettings = fontSettings;
doc.Save(MyDir + "21.9.pdf");