readPresentation(...) Returns a Blank Presentation for Invalid Input

Hello team,

We observed a behavior change after upgrading Aspose.Slides for Java from version 26.2 (currently used in production) to 26.7.

In 26.2, calling PresentationFactory.readPresentation(inputPpt, loadOptions) with an invalid or corrupt presentation caused an
exception to be thrown.

In 26.7, the same invalid input no longer throws an exception. Instead, the API returns a blank presentation.

Sample code

LoadOptions loadOptions = new LoadOptions();
Presentation presentation = PresentationFactory.getInstance().readPresentation(inputPpt, loadOptions);

Observed behavior

  • Version 26.2: exception thrown for invalid input
  • Version 26.7: blank presentation returned for the same invalid input

Expected behavior
For invalid/corrupt input, we expected the API to throw an exception, consistent with version 26.2.

While checking the public release notes for 26.7 published on July 10, 2026, we noticed the loading-related item:

  • SLIDESJAVA-39055 / PptxReadException is thrown when reading PPTX file

Reference:
Aspose.Slides for Java 26.7 Release Notes

However, we could not find any note explicitly stating that invalid presentations should now be loaded as blank presentations
instead of causing an exception.

Could you please clarify:

  1. Is this behavior change in 26.7 intentional?

  2. Is it related to the fix for SLIDESJAVA-39055 or another loading change introduced in 26.7?

  3. Is there any setting or LoadOptions configuration to restore the previous behavior and force an exception for invalid/
    corrupt input?

  4. If this is not intentional, could you log it as a regression relative to 26.2?

If needed, we can provide a sample invalid file that reproduces the issue.

Thanks.

@oraspose,
Thank you for the detailed report.

The Aspose.Slides for Java 26.7 release notes do not indicate an intentional change where invalid or corrupted input should be loaded as a blank presentation instead of throwing an exception.

Please share the sample invalid file that reproduces the issue. We will test the file with versions 26.2 and 26.7 and investigate whether this behavior is related to SLIDESJAVA-39055 or another change.

If the behavior is confirmed to be unintended, we will register it as a regression.

Attached is the small unit-test that demonstrates this change in behavior.
The invalid PPT sample in the unit-test is created ‘on-the-fly’ as following:
byte[] pptbytes = "invalidByteString_expectingException".getBytes();

and is used later as input to
PresentationFactory.getInstance().readPresentation(pptbytes, loadOptions)
PresentationFactoryZeroByteStandaloneTest.zip (643 Bytes)

@oraspose,
Thank you for the unit test. I need some time to investigate the case. I will get back to you as soon as possible.

@oraspose
We apologize for any inconvenience caused. We have reproduced the behavior you described: in Aspose.Slides for Java 26.7, passing an invalid PPT byte array to PresentationFactory.readPresentation returns a blank presentation instead of throwing an exception. This is a confirmed regression and is being tracked internally for a fix.

Issue ID(s): SLIDESJAVA-39849

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@oraspose,
Our developers have investigated the case.

1. Is this behavior change in 26.7 intentional?

Yes, this behavior change is intentional. It results from the implementation of outline import support — as described in Microsoft’s documentation: Create a PowerPoint presentation from an outline.

This functionality was introduced in Aspose.Slides for Java 26.3 (see Release Notes). Consequently, the absence of an error when loading such content (plain text structured as an outline), and the successful creation of a presentation from it, represents the expected behavior.

2. Is it related to the fix for SLIDESJAVA-39055 or another loading change introduced in 26.7?

This change is specifically related to SLIDESNET-45284, not SLIDESJAVA-39055.

3. Is there any setting or LoadOptions configuration to restore the previous behavior and force an exception for invalid/corrupt input?

When loading content that was imported as an outline (e.g., plain text structured as an outline), the resulting presentation is valid and fully functional — it is not considered corrupted. As such, the library does not raise an exception by design.

To detect whether a file was loaded as an outline (i.e., contains only minimal structure), you can do the following:

1) Using PresentationFactory to inspect metadata before full loading

This approach retrieves presentation metadata (including detected format) without fully instantiating the Presentation object, allowing early filtering:

final FileInputStream stream = new FileInputStream("presentation.pptx");
final IPresentationInfo metainfo = PresentationFactory.getInstance().getPresentationInfo(stream);
System.out.println(LoadFormat.getName(LoadFormat.class, metainfo.getLoadFormat())); // The value will be Unknown for outline 

2) Loading the presentation and inspecting DocumentProperties

After loading the presrntation, certain DocumentProperties return 0 values for outline-only content, indicating minimal structural content:

byte[] pptbytes = Files.readAllBytes(Paths.get(folderPath + "presentation.ppt"));
Presentation presentation = null;
try {
    presentation = new Presentation(new ByteArrayInputStream(pptbytes));
    System.out.println(presentation.getDocumentProperties().getSlides());          // 0 for outline 
    System.out.println(presentation.getDocumentProperties().getNotes());           // 0 for outline 
    System.out.println(presentation.getDocumentProperties().getHiddenSlides());    // 0 for outline 
    System.out.println(presentation.getDocumentProperties().getParagraphs());      // 0 for outline 
    System.out.println(presentation.getDocumentProperties().getWords());           // 0 for outline 
    System.out.println(presentation.getDocumentProperties().getMultimediaClips()); // 0 for outline 
} catch (Exception ex) {
    System.out.println("Exception thrown: " + ex.getClass().getName() + ": " + ex.getMessage());
} finally {
    if (presentation != null) {
        presentation.dispose();
    }
}