We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting to PDF Fails with "Bad state (oversubscribed dynamic bit lengths tree)" Exception

Converting specific Powerpoints to PDF fails with Bad state (oversubscribed dynamic bit lengths tree) exception from class com.aspose.slides.internal.fi.extends.

Here is the sample code:

package com.asposeslidestest;

import com.aspose.slides.*;

public class Main {

    /**
     * Run as: java -jar build/libs/AsposeSlidesTest-1.0-all.jar test.pptx test.pdf
     * @param args
     */
    public static void main(String[] args) {
        System.out.println("Using Aspose.Slides: " + License.getVersion());
        if(args.length < 2) {
            System.out.println("You must provide input and output document.");
            System.out.println("  java -jar build/libs/AsposeTest-1.0-all.jar encoding.docx encoding.pdf");
            return;
        }
        String filename = args[0];
        String outputFilename = args[1];

        try {
            LoadOptions loadOptions = new LoadOptions();
            loadOptions.getBlobManagementOptions().setPresentationLockingBehavior(PresentationLockingBehavior.KeepLocked);
            loadOptions.getBlobManagementOptions().setTemporaryFilesAllowed(true);

            Presentation doc = new Presentation(filename, loadOptions);

            PdfOptions options = new PdfOptions();
            INotesCommentsLayoutingOptions notesOptions = options.getNotesCommentsLayouting();
            notesOptions.setCommentsPosition(CommentsPositions.Bottom);

            doc.save(outputFilename, SaveFormat.Pdf, options);

        }catch(Exception e){
            System.out.println(e.getClass());
            System.out.println(e.getMessage());
            System.out.println(e.getStackTrace());
        }
    }
}

This can only be reproduced when our load options sets keep locked and temporary files allowed, and we ask to convert to PDF with comments displayed. All of these options are required for our application.

And here is a sample presentation that exhibits the problem: test.pptx.zip (177.9 KB)

I have observed this on every version of Aspose.Slides from 21.3 and onwards (21.3, 21.4, 21.5 and 21.6).

@sbd

I have created an issue with ID SLIDESJAVA-38571 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.

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