I met some questions about the Aspose.slide. When I generated the documents into pdf format by Aspose.slide on Linux , some of textbox are wrong,i.g. the font type is incorrect, the word is incomplete. However, when I generated documents into ppt format by Aspose.slide on Linux,the documents are in good condition and there is no questions appeared.
Based on the above information, I analyzed it may because the font file was missed. Please kindly confirm this matter and provide one way to solve this issue. THANK YOU FOR YOUR ASSISTANCE!!!
I have worked with sample code shared by you. For further investigation can you please results which you generated on both local and linux environment. Also please share complete environment details with us.ColumnCount.pdf (40.0 KB)
My local version is Window 10 professional and java 1.8 and aspose.slide 18.9.
My Linux is Cent OS 7 and java 1.8 and aspose.slide 18.9.
This is my font folder.
I have observed the issue shared by you and like to share that the fonts issue is happening owing to factor that fonts used in your application may not be installed or accessible in machine where the issue is happening. Aspose.Slides use the default rendering font of machine in case the used font is not available. In your case, you have used following code line to add the fonts. But you need to ensure the availability of these fonts for correct rendering.
This is my code.I get different files like this when I use this code run on my computer and my server.That server is Linux OS.Can you help me solve this problem?Thanks.
Presentation presentation = new Presentation();
ISlide slide = presentation.getSlides().get_Item(0);
I have observed your sample code and its very simple. The problem is in fonts rendering. You please need to ensure that the font is available on both machines. The second issue lies in your code example where you are setting the text on TextFrame level. Please note that font is set on text portion level. So, if you set the text on TextFrame or Paragraph level, the text formatting done on portion level gets reset. In that case the default font used in presentation theme will be used. I suggest you to please try using following sample code along with ensuring availability of font on remote machine.
Have you tried using the sample code that I have shared with you using latest Aspose.Slides for Java 19.11? In my sample code, I have shared the possible optimization that could have been done in sample code to set the text on portion level. This in not an API issue but issue of missing fonts on machine where you are performing rendering.
Even, in image that you have shared the font that has been referred in code is not available in list. One more suggestion that I can offer in your case is that you copy all the fonts from machine where rendering is done fine to a accessible directory on your target Linux machine. Then you call that font directory externally in your application and then load presentation to perform rendering.
More importantly, please try using latest Aspose.Slides for Java 19.11 on your end and share if the issue is still reproduced.
I update my code.
FontsLoader.loadExternalFonts(new String[]{“template/fonts”});
Presentation presentation = new Presentation();
ISlide slide = presentation.getSlides().get_Item(0);
But I get files as follows.Desktop.zip (21.1 KB)
I dont think this is my font directory externally problem. Because the remote.pdf some fonts display correctly.And My Aspose.Slide verion is 19.11.
I have observed the issue shared by you and have created an issue with ID SLIDESJAVA-38006 in our issue tracking system as enhancement to further observe this. This thread has been linked with the issue so that you may be notified once the issue will be fixed.