How to Get the Slide Number of Layouts & Masters Using Aspose.Slides for Java?

HI,

How to get the slide number of master & layout sildes. In the ISlide class, it does have the getSlideNumber() method which will return of the current slide number. But IMasterSlide & ILayoutSlide does not have this method. Kindly help us to resolve this.

@johnson123,
Thank you for posting the question.

To get the number of masters and layouts, you can use the IMasterSlideCollection and IMasterLayoutSlideCollection interfaces like this:

var masterCount = presentation.getMasters().size();
System.out.println("The number of master slides: " + masterCount);

var firstMaster = presentation.getMasters().get_Item(0);
var layoutCount = firstMaster.getLayoutSlides().size();
System.out.println("The number of layout slides: " + layoutCount);

If this does not help, please describe the issue in more detail.

See also: Presentation Slide