Presentation.save Method Throws an ArgumentOutOfRangeException When a Slide Number Array Contains 0

the save method for presentation pass in slide numbers will throw exception as long as slide number start from 0.

com.aspose.slides.exceptions.ArgumentOutOfRangeException: ‘slides’ array contains 0 slide position, which is not present in the presentaiton.

@Test
public void testSlideStartsFrom_0() throws IOException {
    IPresentation pres = new Presentation("BasicSlideStartFromNumber0.pptx");
    int[] slideNumbers = {0};
    pres.save("testPptxToPdf.pptx", slideNumbers, SaveFormat.Pptx);
}

@oraspose,

I have observed the information shared by you and request you to please provide the source presentation file with us reproducing the issue on your end. Please also try using Aspose.Slides for .NET 17.7.0 on your end as well before sharing further information with us.

BasicSlideStartFromNumber0.zip (23.1 KB)

we have tried aspose.slides for java version 17.7, the problems exist

@oraspose,

I have worked with source code and presentation file shared by you using Aspose.Slides for Java 17.7 and have been able to observe the issue. A ticket with ID SLIDESJAVA-36545 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

We are sorry for your inconvenience,

any progress on this ?

@oraspose,

I have verified the issue status from our issue tracking system and regret to share that at present the issue is still unresolved and we will share good news with you as soon as the issue will be fixed.

Hello team.
Just wanted to follow up on this long outstanding issue - what the status is.
Is it classified as not a bug (which seems to be the case according to the save( String fname, int[] slides, int format) api documentation), or are the any plans to resolve it soon?
Thank you.

@oraspose,
An ArgumentOutOfRangeException occurs because the slideNumbers array must start at 1.

Anyway, the method

pres.save("testPptxToPdf.pptx", slideNumbers, SaveFormat.Pptx);

cannot be used to save specific slides for PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, POT, ODP, PPS, OTP, XML formats.

To save specific slides for these formats, clone the required slides into a new presentation:

Presentation presentation = new Presentation("BasicSlideStartFromNumber0.pptx");
Presentation clonedPresentation = new Presentation();

clonedPresentation.getSlides().removeAt(0);
clonedPresentation.getSlides().insertClone(0, presentation.getSlides().get_Item(0));
clonedPresentation.save("BasicSlideStartFromNumber0-clone.pptx", SaveFormat.Pptx);

clonedPresentation.dispose();
presentation.dispose();

More examples:
Clone Slides|Aspose.Slides Documentation