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)
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);
@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?
Hi,
In the Word document, it is the “Wingdings 3” font. But while converting this word to PDF, it became “Wingdings”. Me also, it is working perfectly in my local. But while generating from the hosted web server, this is happening. Can you please guide me? Is there anything I need to write in code while converting to PDF?
@jithin.p Please ensure that the Wingdings 3 font is installed on your server. 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:
Ok, thanks for the information. If I am using the below code, it will load the fonts from the system folder, and if it is not there, I need to take from the below path. Is this work? Can you please confirm?