Aspose.Words.Document convert changing icons

Hello,

I have a attached a couple documents that when converted to PDF will result in rendering issues. The code is just a simple conversion from word to pdf using Aspose.Words (23.3.0)

(Icons are being converted to other icons)
Health Canada QIU (2).docx (120.0 KB)

(Content is being pushed onto the second page and partially cut off)Financial Disclosure Form - Sauder (1).docx (41.8 KB)

The document above that is having overflow does not have the same overflow effect when it becomes a docx, but will have issues if the file is a .doc. I am unfortunately unable to upload .docs here.

Aspose.Words.Document document = new Aspose.Words.Document(docFilePath);
        document.Save(tempConvertedDocPath, SaveFormat.Pdf);

Is this a bug or a way to resolve this?

Thanks

@OpenDevSolutions I have tested conversion of your documents on my side.

  • Health Canada QIU (2).docx the result of conversion is identical to PDF produced by MS Word. Could you please attach your output PDF document for our reference and specify what icons have been changed? here is output produced on my side using the latest 23.6 version of Aspose.Words: out.pdf (177.2 KB)

  • Financial Disclosure Form - Sauder (1).docx. The same with the second document. The result of conversion is correct on my side: out2.pdf (97.7 KB)

Thanks for the response alexey. Sorry for the delay. It appears the conversion works locally on my machine but does not on my server hosted on AWS. For the life of me, I cant find a difference. Using the exact same file and function in both situations are yielding different icons.

I thought maybe the .dll on the server was mismatched somehow but they appear to match. I assume that for this conversion to work, just Aspose.Words.dll should be identical? Are there potentially other dependencies that could effect this function?

@OpenDevSolutions Could you please attach the problematic PDF output documents produced on your side? Also, please provide your environment details.

Layout issues upon rendering document to PDF might occur because the fonts required for rendering document are not available in the environment where document is converted. 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 and also to different PDF file size and binary representation. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to lean where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/

The AWS server is missing Wingdings 2 Regular. I will have to find a way to include this when processing documents. Is it possible to load multiple font sources, one defaulting to the C:\Windows\Fonts and another to my application?

Thanks

@OpenDevSolutions Sure, you can specify multiple font sources using FontSettings.SetFontsSources.