# 使用 Java 解锁 PPT 演示文件

> Java 源代码，用于移除 PPT 演示文稿的保护。

Source: https://products.aspose.com/slides/zh/java/unlock/ppt/
Updated: 2023-06-07



## 通过 Java 从 PPT 演示文稿中删除加密

使用 Aspose.Slides for Java，您可以取消对 PPT 演示文稿的加密或密码保护。这样，用户就可以不受限制地访问或修改 PPT 表示。

### 使用 Java 从 PPT 禁用密码保护

```java

LoadOptions loadOptions = new LoadOptions();
loadOptions.setPassword("123123");
Presentation presentation = new Presentation("pres.ppt", loadOptions);
try {
    presentation.getProtectionManager().removeEncryption();
    presentation.save("encryption-removed.ppt", SaveFormat.Ppt);
} finally {
    if (presentation != null) presentation.dispose();
}
```

### 使用 Java 从 PPT 演示文稿中删除写保护

```java

Presentation presentation = new Presentation("pres.ppt");
try {
    presentation.getProtectionManager().removeWriteProtection();
    presentation.save("write-protection-removed.ppt", SaveFormat.Ppt);
} finally {
    if (presentation != null) presentation.dispose();
}
```

## 如何通过 Java 从 PPT 中删除密码

这些是取消 PPT 文件保护的步骤。

使用 Presentation 实例加载 PPT

使用 ProtectionManager 类删除写保护

以 PPT 格式保存结果

## 其他支持的格式
