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

Free Support Forum - aspose.com

How to Add Slide Numbers from the Second Slide Using Aspose.Slides for .NET?

I want to show slide number from second slide and skip to first slide.
and It should be dynamic, which means that if I added or deleted slides from any two sides, all slide numbers should be automatically reset.

what I’ did now :

Presentation sp = new Presentation(“E:/research/Presentation.pptx”);
sp.Save(“E:/research/op.pptx”, SaveFormat.Pptx);

It’s showing me slide numbers in each page, I want to skip first page and start slide numbers from second page like:

first slide: [no slide number]
second slide: 1
third slide: 2
and so on.

Any one have idea how can I achieve this using aspose slide dotnet c# ? :slight_smile:

image.png (124.7 KB)

Thank you for posting the question.

To achieve your requirements, you should use the IPresentationHeaderFooterManager interface, ISlideHeaderFooterManager interface, and the FirstSlideNumber property. The following code snippet shows you how to do this:

sp.FirstSlideNumber = 0;

Thanks a lot @Andrey_Potapov
It is working for me for skip first page.

but when I tried for skip 2 page and start slide number it’s showing me error, you can see in attached image. this is my future requirement so if you have any solution for this then it’ll be great. :grinning:

        Presentation sp = new Presentation("E:/research/kathi_demo.pptx");
        sp.FirstSlideNumber = -1;
        sp.Save("E:/research/op.pptx", SaveFormat.Pptx);

Thanks again for first solution. :slight_smile:

image.png (25.9 KB)

It looks like your new requirements cannot be achieved automatically in the same way. PowerPoint documents allow you to start slide numbers automatically from 0 or greater. You can only set all slide numbers manually excluding the first two slides.