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

Free Support Forum - aspose.com

getAlternativeTextTitle Method Returns Null when a Shape Is Cloned

Hello,

The alternative text title property is lost when a shape is cloned. The following piece of code prints null instead of Hello!.

    Presentation presentation = new Presentation();
    ISlide slide = presentation.getSlides().get_Item(0);
    IShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 50, 300, 150);
    shape.setAlternativeTextTitle("Hello!");
    IShape cloneShape = slide.getShapes().addClone(shape);
    System.out.println(cloneShape.getAlternativeTextTitle());

In addition to that, it seems that the alternative text title property is also lost when a presentation is saved (perhaps shapes are cloned during the saving process). Here is my code:

    Presentation presentation = new Presentation("D:\\Presentation1.pptx");
    ISlide slide = presentation.getSlides().get_Item(0);
    IShape shape = slide.getShapes().get_Item(0);
    shape.setAlternativeTextTitle("Hello!");
    presentation.save("D:\\Presentation1_copy.pptx", SaveFormat.Pptx);

When I open “D:\Presentation1_copy.pptx” in MS Powerpoint, the alternative text title is empty on the first shape.

Could you please fix it? I tried aspose-slides-21.6-jdk16.jar as well as aspose-slides-22.11-jdk16.jar (latest release) but both versions give me the same results.

Thanks for your help.

Regards,
Brice

@bpoussin,
I was able to reproduce the problems you described with Aspose.Slides 21.6, but they do not appear in Aspose.Slides 22.11 on my end. Please check your results with version 22.11 carefully again. If the issue persists, please share the following information:

  • OS version on which the code was executed
  • JDK version in your app

You’re right, I checked again and it works fine with version 22.11.
Thanks again for your help.

@bpoussin,
Thank you for using Aspose.Slides.