Free Support Forum - aspose.com

Exception" Cannot find any fonts installed on the system" when loading PPTX (Java)

Using Aspose Slides for Java 17.9.1 and running on Redhat.

We have a Powerpoint conversion process which will load an existing PPT or PPTX files, remove certain features (actions / macros) and then save the presentation in the same format.

The server has no fonts installed. This does not seem to be a problem for PPT files but throws an exception when saving a PPTX file.

            Presentation presentation = new Presentation(in);
            presentation.save(out, SaveFormat.Pptx);

When I try and save a PPTX I get the following:

Caused by: class com.aspose.slides.exceptions.InvalidOperationException: Cannot find any fonts installed on the system.
com.aspose.slides.internal.e8.else.do(Unknown Source)
com.aspose.slides.internal.e8.else.do(Unknown Source)
com.aspose.slides.internal.e8.else.do(Unknown Source)
com.aspose.slides.s3.do(Unknown Source)
com.aspose.slides.sq.<init>(Unknown Source)
com.aspose.slides.s3.if(Unknown Source)
com.aspose.slides.s3.do(Unknown Source)
com.aspose.slides.a2w.int(Unknown Source)
com.aspose.slides.a2w.extends(Unknown Source)
com.aspose.slides.a1o.do(Unknown Source)
com.aspose.slides.a1o.do(Unknown Source)
com.aspose.slides.a1o.<init>(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.else(Unknown Source)
com.aspose.slides.ah.do(Unknown Source)
com.aspose.slides.vp.do(Unknown Source)
com.aspose.slides.vp.do(Unknown Source)
com.aspose.slides.b1.do(Unknown Source)
com.aspose.slides.avn.do(Unknown Source)
com.aspose.slides.apv.do(Unknown Source)
com.aspose.slides.apv.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.save(Unknown Source)

In an attempt to resolve this issue, I have tried:

  1. Using the FontsLoader.loadExternalFont(byte[]) method to add a single ttf file - this made no difference.

  2. Using the FontsLoader.loadExternalFonts(String[]) method to add the path to the folder containing the same ttf file - this solved the problem.

It seems like saving a presentation with SaveFormat.PPTX will fail unless there is at least one font file loaded from a folder.

Saving to PPT format works fine with no fonts loaded.

I have tried using the Aspose slides 17.8, 17.9, 17.9.1 and 17.12.1 libraries, based on various discussions on these forums. All have the same result.

Can you please advise why the behaviour is different between saving as PPT and saving as PPTX. Also, what is the correct approach?

Thanks for your help.

@james.cross,

I have observed your comments. Can you please share source presentation along with environment details so that we may further investigate to help you out. Also i like to suggest you before sending requested files can you please try to use Aspose.Slides latest version 17.12.1 on your end and if there is still an issue than please share source files.

Thanks Adnan

failingpptx.pptx.zip (37.4 KB)

The file in question is attached above.

As an update to what I have tried here. I ran through my test with various versions of the Aspose Slides jar. I tried using the Aspose slides 17.8, 17.9, 17.9.1 and 17.12.1. I actually noticed my workaround (using FontsLoader.loadExternalFonts() ) only works when I use version 17.8 of the jar file. The workaround stops working when I update it to 17.12.1

Some additional info

OS:

Red Hat Enterprise Linux Server release 6.8 (Santiago)

Java:

java version “1.8.0_73”
Java™ SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot™ 64-Bit Server VM (build 25.73-b02, mixed mode)

Also, I using the jar files from MVN with the following classifier: jdk16

@james.cross,

I have worked with source presentation shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-36907 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

Thanks Adnan.

As we have a workaround this is not too urgent, however, my client has paid support. If they decide it is urgent, can we just reference the issue ID SLIDESJAVA-36907 when raising a ticket?

Thanks again

@james.cross,

Yes, you can refer the ticket ID in Paid Support Helpdesk with concerned team and they will consider this ticket with appropriate priority level.

@james.cross,

I like to inform that we have investigated issue on our end and we have found that this exception occurs, because Aspose.Slides can’t access to the fonts. Can you please check the permissions of fonts or use FontsLoader if fonts are not available at all on the your server (or you can manually install fonts on server).

The issues you have found earlier (filed as SLIDESJAVA-36907) have been fixed in this update.