Convert Word docuemnt to PDF document not retaining the fonts and styles

Hi,

We are converting the word document to pdf using Aspose.Words component, found that the generated PDF document lost the original fonts and styles compared to word document.

For your better understanding the I have attached the source code (Program.zip) and input template file (Template1.docx)

Also attached the image highlighting the issue what is the issue about conversion (Issue.png)

Can you please let me know what’s wrong with the code and what is the best way to fix it for any font/style should go to PDF?

Program.zip (627 Bytes)
Template1.docx (30.2 KB)

@srinudhulipalla Most likely the problem on your side might occur because the fonts used in your input document are not available on the machine where document is converted to PDF. 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/

The TH Sarabun New font used in your document is not available on my side. Could you please attach this font here for testing and make sure the font is available in the environment where the document is processed on your side.

Hi,

Unfortunately the font “TH Sarabun New” is not with me. But when I open the word document I can see in the list of available fonts inside the document itself. Which mean I should see the same in PDF as well after conversion, right?.

My question still remain same, when word document can render the “TH Sarabun New” font when it is not available in the machine, then why can’t the PDF conversion do the same as well?

@srinudhulipalla The font is MS Word Cloud Font, so MS Word downloads it on demand. Aspose.Words does not support cloud fonts, so you should either download and provide the required fonts or embed the required fonts into the document in MS Word.