Dear Team,
I am using the “Aspose Words for JAVA” product to generate Word and PDF Documents.
We are facing an issue with loading fonts in Output PDF document only in Production Systems. When checked it is always rendering with “FANWOOD” font.
To give even more details about the system properties, the application is deployed in the server which has
1. UNIX O/S
2. Java Application is running on JBOSS WebServer installed on UNIX.
And
When I am running it as localhost application it is working fine. Here my desktop level properties are
1. Windows 7 O/S
2. Java Application running in Apache Tomcat 7
Kindly help in resolving the issue.
Thanks and Regards
Pradeep Goli
Hi Pradeep,
Thanks for your inquiry. You need to install fonts on your server machine for proper rendering of your Word documents. You can copy these fonts from Windows machine to the other machine. Please also refer to the following articles:
Hope, this helps.
Best regards,
Dear Team,
I Tried the below Options:
1. Copied all windows fonts to unix servers in different locations i.e.
/usr/share/fonts/
/usr/share/fonts/truetype/
2. Tried the following Code:
// If the default font defined here cannot be found during rendering then the closest font on the machine is used instead.
FontSettings.setDefaultFontName(“Arial”);
3. Tried the following Code - In Log Files no warnings are captured
// Create a new class implementing IWarningCallback which collect any warnings produced during document save.
HandleDocumentWarnings callback = new HandleDocumentWarnings();
doc.setWarningCallback(callback);
But the system is picking up only the “FANWOOD” font by default.
Please provide some suggestions on how to load fonts properly while rendering.
Thanks and Regards
Pradeep
Dear Team,
I checked with my admin team they told access/read permissions to the folder are provided already.
As requested I am attaching the code, template, output pdf(PROD Test Case, QA Test Case) for reference.
Please help us in providing some suggestions on clearing the issue.
Thanks
Pradeep
Hi Pradeep,
Thanks for your inquiry. We have noticed that the PDF files were generated by using an old version of Aspose.Words for Java i.e. 15.7.0. We suggest you please upgrade to the latest version of Aspose.Words for Java (16.5.0) from the following link:
Hope, this helps.
Best regards,