Free Support Forum -

PPTX to PDF conversion fails to embed fonts using Aspose.Slides

When attempting to embed a TTF font in a Powerpoint presentation (pptx) using Aspose, the FontsLoader.loadExternalFont throws an exception:

Input: input.pptx
Fonts: [Zapfino.ttf, Bradley Hand.ttf, Gurmukhi MT.ttf]

  • Caused by: com.aspose.slides.exceptions.FileNotFoundException: File not found —> File not found
  • Caused by: com.aspose.slides.exceptions.FileNotFoundException: File not found —> Font name not found

Product: Aspose.Slides
version: [20.1, 20.5]

All files are in the attached (658.4 KB)


I have observed the issue shared by you and a ticket with ID SLIDESJAVA-38124 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 notified once the issue will be fixed.


We have worked over the issue. This exception occurs because the array (fontData) contains invalid data (str. 332 in

byte [] fontData = getCustomFont(fontName);

The FontsLoader is trying to create a temporary file from ‘fontData’, but since this array is corrupted, this attempt fails with an exception. Can you please verify the segment of code in ‘getCustomFont(fontName)’ method or please provide us code for getCustomFont() method in


See the below code snippet for the getCustomFont method:

protected byte[] getCustomFont(String s3Key) {
    try {
        System.out.println("Attempting to fetch custom font Fonts/" + s3Key);

        InputStream fontStream ="Fonts/" + s3Key);
        return Utils.getBytes(fontStream);
    } catch (Exception exception) {

    return null;

Here is the code for the (other methods in this function are from the AWS s3 lib)

public InputStream getObject(String key) {
    S3Object object = s3.getObject(bucket, key);
    return object.getObjectContent();

And the Utils.getBytes:

public static byte[] getBytes(InputStream is) throws Exception {
    byte[] buffer = new byte[8192];
    ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
    int n;
    while ((n =, 0, buffer.length)) != -1) {
        baos.write(buffer, 0, n);
    return baos.toByteArray();


Thank you for sharing requested information. We will share feedback with you as soon as issue will be addressed.

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