Determine in Java If a TextBox in a Presentation Contains Slide Number (723)

Hi,

I have a specific presentation which has a textbox containing slide number. If you, for example, duplicate any slide, the number in the textbox will be changed. How can I determine if the particular textbox contains slide number using Aspose.Slides?


Thanks,
Zeljko


Hi Zeljko,


I have observe your requirements. We are looking into this and will get back to you with feedback soon.

Best Regards,

Hi Zeljko,

I have observe your comments. I have shared code snippet with you. I like to inform that You may use PlaceholderType.SlideNumber property. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

IShape shape = (IShape)tmp0.next();

if (shape.getPlaceholder() != null && 
        shape.getPlaceholder().getType() == PlaceholderType.SlideNumber)
{
    // Do something
}

Best Regards,

Hi Muhammad,

Thank you for the code snippet. Unfortunately, it doesn’t work for me, as shape.getPlaceholder() returns null.

Here’s the code to confirm this using the file attached in my previous post:

String path = "SlideNumberInTextBox.pptx";
Presentation presentation = new Presentation(path);
ISlide slide = presentation.getSlides().get_Item(0);
IShape shape = slide.getShapes().get_Item(0);

System.out.println(shape.getPlaceholder() == null);

Output:

true

Is there anything else I can do?

Regards,
Zeljko

Hi Zeljko,


I have observed your comments. We are looking into this and will get back to you with feedback soon.

Best Regards,

Hi Zeljko,


I have shared piece of code in a text file with you. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

Best Regards,

Is it possible for me to see this code?
I am also running into the same issue where I need to renumber the slides.

@nikhil.x7,
Could you please describe in more detail the issue you are encountering? We will do our best to help you.