PPT PPTX ODP POT ppsx
Aspose.Slides  for Java
PPT

Lock or Password Protect PPT using Java

Build your own Java apps to protect presentation files using server-side APIs.

Protecting a PPT Presentation via Java

Using Aspose.Slides for Java, you can protect your PPT presentation from opening or modification by setting a password. Then, to open or modify the locked presentation, a user has to provide the password.

Encrypting a PPT Presentation using Java


Presentation presentation = new Presentation("pres.ppt");
try {
    presentation.getProtectionManager().encrypt("123123");
    presentation.save("encrypted-pres.ppt", SaveFormat.Ppt);
} finally {
    if (presentation != null) presentation.dispose();
}

Setting Write Protection to a PPT Presentation using Java


Presentation presentation = new Presentation("pres.ppt");
try {
    presentation.getProtectionManager().setWriteProtection("123123");
    presentation.save("write-protected-pres.ppt", SaveFormat.Ppt);
} finally {
    if (presentation != null) presentation.dispose();
}

How to Password Protect PPT via Java

These are the steps to Protect PPT files.

  1. Load PPT with an instance of Presentation

  2. Protect the presentation using ProtectionManager class

  3. Save result in PPT format

Other Supported Protect Formats

Using Java, You can also protect the following formats: