Word to PDF conversion changes layout/font size

When converting/saving Word document as PDF, the layout of the document can slightly change. The text that takes up an entire line in Word doc, breaks into new line in PDF. It looks like the font is slightly increasing. When we preview the properties in the code, we see that the formatting does not change.

The issue happens on Aspose.Words 23.11.0 but we also checked with newest version 24.8.0 and the same issue happens.

Attached Word and PDF documents:
fonts.docx (14.4 KB)
fonts.pdf (79.4 KB)

@abruks The problem on your side might occur because the fonts used in your input document are not available on the machine where document is processed. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted. This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/

As I can see your document uses Aptos font, which is cloud MS Word font and is not usually installed in the system. MS Word downloads it from cloud on demand. You can download this font from here:
https://www.microsoft.com/en-us/download/details.aspx?id=106087

If install this font, the document is rendered properly.
Aspose.Words: out.pdf (76.7 KB)
MS Word: ms.pdf (126.8 KB)

1 Like

Thank you Alexey,
it was extremely helpful. Indeed installing Aptos font on the server helped.

1 Like