I am trying to convert a .docx file (containing Amharic/Nyala font) to pdf. This specific font is not getting displayed correctly after the conversion. I am uploading the input and output file. It would be great if you could help me in this matter.
Please install these fonts on your machine where you want to perform this Word to PDF conversion. Please refer to the following sections of documentation:
Thank you for your quick response. I would like to mention that I am working on Windows OS so I am not really sure if TrueType Fonts would help. As per your suggestion, I upgraded to the latest 21.9 version of Aspose.Words for Java. Unfortunately it did not work. I am still getting the same output as before. I would like to share a piece of code that I am using while converting a document.
Document doc = new Document(srcFilePath);
PdfSaveOptions options = new PdfSaveOptions();
options.setCompliance(PdfCompliance.PDF_17);
doc.save(destFilePath, options);
Could you please guide me in the right direction? Are there any specific APIs that I can call on options to fix this issue? Also, do you know how to set the encoding format and will it help in this case?
In this case, your Word document uses Nyala and Times New Roman fonts. Please copy the latest versions of these required font files into a separate folder inside your Windows machine and try running the following code of latest 21.9 version of Aspose.Words for Java:
Document doc = new Document("C:\\Temp\\word.docx");
FontSettings fontSettings = new FontSettings();
addFontFolder(fontSettings, myDir + "Custom Fonts Folder/");
doc.setFontSettings(fontSettings);
doc.save("C:\\Temp\\word to.pdf");