Apply Password Protection in Aspose.Slides

Aspose.Slides - Apply Password Protection

It’s possible to save presentations with password protection. The Presentation class exposes theEncrypt method which sets a password for the presentation. To do this, simply pass the password to the Encrypt method and then use the Save method exposed by the Presentation class as a string to save the presentation.

Java


 //Instantiate a Presentation object that represents a PPT file

Presentation pres = new Presentation();

//Setting Password

pres.getProtectionManager().encrypt("pass");

//Save your presentation to a file

pres.save(dataDir + "AsposeProtection.pptx", com.aspose.slides.SaveFormat.Pptx);

Download Running Code

Download Sample Code