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

Free Support Forum - aspose.com

Cloning slides and make them password protected

Dear Aspose Team

I am wondering is it possible to clone slides and generate a password protected PPT or PPTX file out of these cloned slides.

Thanks in advance for a quick response.

Hi,

Thanks for using Aspose.Slides,

I am working on your query, I will post my finding in the form of working code shortly,

Thanks for your patience

Hi,

Please accept my sincere apologies for the delay, after detail investigation we regret to inform you that unfortunately the feature of password protection on the presentation files is not supported in Aspose.Slides for Java at the moment. Whereas same feature is available in Aspose.Slides for .NET. Our development team is currently working over highest priority auto porting project that will port Aspose.Slides for .NET features in Aspose.Slides for Java. Once, the issue will be resolved, we will be more than happy to share the information with you.

If you need to clone a slide from one presentation and use it in another presentation. Please use following code snippet.

For ppt presentation.

try
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres1=new Presentation(new FileInputStream(new File("source.ppt")));
//Instantiate a Presentation object that represents a PPT file
Presentation pres2=new Presentation(new FileInputStream(new File("destination.ppt")));

//Accessing a slide using its slide position
Slide slide = pres1.getSlideByPosition(5);


//Creating TreeMap object that is used to store the temporary information
//about the masters of PPT file. No value should be added to it.
TreeMap tMap=new TreeMap();
//Cloning the selected slide at the end of another presentation file
pres1.cloneSlide(slide,pres1.getSlides().getLastSlidePosition() + 1,pres2,tMap);

//Writing the presentation as a PPT file
pres2.write(new FileOutputStream(new File("modified.ppt")));
}
catch(Exception ex)
{
System.out.println(ex.toString());
}

For pptx presentation.
try {
//Instantiate PresentationEx class to load the source PPTX file
PresentationEx srcPres = new PresentationEx("d:\\pptx\\helloworld.pptx");
//Instantiate PresentationEx class for destination PPTX (where slide is to
//be cloned)
PresentationEx destPres = new PresentationEx();

//Clone the desired slide from the source PPTX to the end of the collection
//of slides in the destination PPTX
SlidesEx slds=destPres.getSlides();
slds.addClone(srcPres.getSlides().get(0));

//Write the destination PPTX to disk
destPres.write("d:\\pptx\\helloworld_dest.pptx");
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

If you require any further information, please feel free to contact us.

We are sorry for your inconvenience,

Could you please ask teh dev team when this feature will be available for Java.Slides to create password protected PPT presentations

Hi,

According to our roadmap, I am happy to share that Password Protection feature for Aspose.Slides for Java will be available in version 3.0.0 which will be most likely to release at the end of May, 2012.

We are sorry for your inconvenience and really appreciate your patience,

Thanks for your cooperation.