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

Free Support Forum - aspose.com

Getting the Height of a Table Cell Throws KeyNotFoundException

Please browse the files in the compressed package.
SimpleTable.pptx.zip (27.5 KB)
I just create a default table using powerpoint and run the follwing code.

Presentation presentation = new Presentation(filePath);
((Table)presentation.getSlides().get_Item(0).getShapes().get_Item(0)).get_Item(0, 0).getHeight();

It throw KeyNotFoundException.

class com.aspose.slides.exceptions.KeyNotFoundException: The given key was not present in the dictionary.
    com.aspose.slides.Collections.Generic.SortedList$ThrowHelper.throwKeyNotFoundException(Unknown Source)
        com.aspose.slides.Collections.Generic.SortedList.get_Item(Unknown Source)
        com.aspose.slides.internal.o0.break.<init>(Unknown Source)
        com.aspose.slides.internal.o0.long.goto(Unknown Source)
        com.aspose.slides.internal.o0.long.case(Unknown Source)
        com.aspose.slides.internal.o0.extends.do(Unknown Source)
        com.aspose.slides.sd.do(Unknown Source)
        com.aspose.slides.sd.do(Unknown Source)
        com.aspose.slides.sd.do(Unknown Source)
        com.aspose.slides.sd.do(Unknown Source)
        com.aspose.slides.rr.do(Unknown Source)
        com.aspose.slides.av2.do(Unknown Source)
        com.aspose.slides.rr.do(Unknown Source)
        com.aspose.slides.ol.do(Unknown Source)
        com.aspose.slides.sj.do(Unknown Source)
        com.aspose.slides.ax1.static(Unknown Source)
        com.aspose.slides.z2.do(Unknown Source)
        com.aspose.slides.axu.do(Unknown Source)
        com.aspose.slides.axu.<init>(Unknown Source)
        com.aspose.slides.axl.do(Unknown Source)
        com.aspose.slides.awg.do(Unknown Source)
        com.aspose.slides.awg.for(Unknown Source)
        com.aspose.slides.Row.getHeight(Unknown Source)
        com.aspose.slides.Cell.getHeight(Unknown Source)

Thank you for reporting the issue. We will check it and reply to you as soon as possible.

Thank you for your attention and reply. This exception causes the function we developed earlier to fail to work properly.

Unfortunately, I have not managed to reproduce the error you encountered. Please check your results using the latest version of Aspose.Slides if it is possible. If the issue persists, please share the following information:

  • OS version on which the code was executed
  • JDK version in your app
  • any additional information about your runtime environment

When I use 22.9, it does no throw exception. If I change to 22.11, It throw KeyNotFoundException.
OS: macOS 13.0.1
JDK: openjdk-17.0.1
SDK: Aspose.Slides.Java 22.11

Thank you for the additional information. I’ve added a ticket with ID SLIDESJAVA-38999 to our issue-tracking system. Our development team will investigate the case. We will inform you of any progress.

Thank you for your reply. It works well on the Linux server. I don’t know what caused this. I will try to find more Mac Book to see if this problem will occur.

Thank you for the additional information. I’ve forwarded it to our developers.

The issues you found earlier (filed as SLIDESJAVA-38999) have been fixed in Aspose.Slides for Java 22.12 (ZIP).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.