I’m trying to convert a word file into a pdf file using aspose words 18.10.
The original word and the result pdf documents are Archive.zip (16.5 KB)
.
As you can see de char is not being generated correctly.
This works perfectly running the program on windows, but not for a Mac OS.
Is there any way to fix this?
If you still face problem, please ZIP and attach your problematic output PDF here for testing. We will investigate the issue and provide you more information on it.
Hi @tahir.manzoor,
Thank you for the feedback.
I already tried with the Aspose words, 19.11 and the problem persists.
The problematic output PDF is exactly the same file shared on the archive above.
Please investigate this.
We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19679. You will be notified via this forum thread once this issue is resolved.
After further investigation of this issue, we have noticed that this issue is related to missing fonts. Please make sure that you have installed ‘Segoe UI Symbol’. We have attached the output PDF with this post for your kind reference. 19.12.pdf (6.6 KB)
We suggest you please copy all fonts in a folder and use following code example to test this case. Hope this helps you.
public static void TestCase1() throws Exception
{
ArrayList fontSources = new ArrayList(Arrays.asList(FontSettings.getDefaultInstance().getFontsSources()));
// Add a new folder source which will instruct Aspose.Words to search the following folder for fonts.
FolderFontSource folderFontSource = new FolderFontSource("/home/tahir/Fonts/", true);
// Add the custom folder which contains our fonts to the list of existing font sources.
fontSources.add(folderFontSource);
// Convert the Arraylist of source back into a primitive array of FontSource objects.
FontSourceBase[] updatedFontSources = (FontSourceBase[]) fontSources.toArray(new FontSourceBase[fontSources.size()]);
// Apply the new set of font sources to use.
FontSettings fontSettings = new FontSettings();
fontSettings.setFontsSources(updatedFontSources);
for (PhysicalFontInfo fontInfo : (Iterable<PhysicalFontInfo>) updatedFontSources[0].getAvailableFonts())
{
System.out.println("FontFamilyName : "+ fontInfo.getFontFamilyName());
System.out.println("FullFontName : " + fontInfo.getFullFontName());
System.out.println("Version : " + fontInfo.getVersion());
System.out.println("FilePath : " + fontInfo.getFilePath());
}
Document doc = new Document("/home/tahir/input docs/DEM-22-8.docx");
doc.setFontSettings(fontSettings);
doc.setWarningCallback(new com.aspose.words.IWarningCallback() {
@Override
public void warning(com.aspose.words.WarningInfo warningInfo) {
if(warningInfo.getWarningType() == WarningType.FONT_SUBSTITUTION)
System.out.println(warningInfo.getDescription());
}
});
doc.save("/home/tahir/input docs/19.12.pdf");
}
Hi @tahir.manzoor,
Thank you for the feedback.
I already tried exactly your suggestion, and the output is the same, I can’t use the Segoe UI Symbol on PDF.
Are you sure that this solution is working?
Kind regards,
Paulo Pereira
Please share the output generated by ‘System.out.println’ by using code example shared in my previous post. Moreover, please ZIP and attach the output PDF generated by the latest version of Aspose.Words for Java 20.1.
Moreover, please restart your system before testing this case. Thanks for your cooperation.
The shared PDF file is generated by Aspose.Words 19.11 version. Please use the latest version of Aspose.Words for Java and apply the license before document conversion. You can get the 30 days temporary license from here: Get a Temporary License
We have tested the scenario at MAC operating system and have not found the shared issue. We copied all fonts from Windows operating system to MAC and used your code to test this case. The output is correct. Please check the attached image and output PDF.mac output.png (63.9 KB) 20.1.mac.pdf (6.6 KB)