Converting docx to pdf(MssDocToPdf) changes the font

Hello,

My problem consists in changing the font when converting from docx to pdf. In this case the document is in Garamond(font) and contains 24 pages but after the conversion the font is different and takes up more space and makes the pdf document increase in size in this case to 37 pages.

Thanks in advance.

Greetings,
João

@PTDLPPLRunTeam Could you please ensure that all the required fonts are installed and available in your current environment? You can easily verify this by implementing the IWarningCallback interface. If Aspose.Words API cannot find the specified font, it will perform a substitution.

Document doc = new Document("C:\\Temp\\input.docx", new LoadOptions
{
    LoadFormat = LoadFormat.Docx,
    WarningCallback = new IssueCallBack(),
});
public class IssueCallBack : IWarningCallback
{
    public void Warning(WarningInfo info)
    {
        Console.WriteLine($"{ info.Description}");
    }
}

Additionally, if your document relies on cloud fonts, such as Open Sans, please note that Aspose.Words does not load cloud fonts by default. To ensure the desired output, you have two options:

  1. Embed the font into the MS Word document: You can follow Microsoft’s guide on embedding custom fonts to embed the font directly into your document.
  2. Specify the font as a source: Alternatively, you can place the font file in a specific folder and specify that folder as a font source in Aspose.Words. This allows Aspose.Words to locate and use the font during document processing.

By ensuring that the required fonts are available and taking one of the above steps, you can achieve the desired output with proper font rendering in your documents.