Java 删除PPT幻灯片中的数字签名
针对PPT幻灯片中已有的数字签名,若想删除来添加签名可参考以下方法来实现如何删除。
工具/材料
IntelliJ IDEA 2018
PowerPoint 2013
JDK 1.8.0
spire.Presentation.jar 4.3.2
操作方法
01、
源文档准备:准备一个已签名的PPT幻灯片文档,如图:
02、
在IDEA程序中一入spire.presentation.jar,
03、
键入如下代码:import com.spire.presentation.*;public class RemoveSignature { public static void main(String[] args) throws Exception { //加载PPT文档 Presentation ppt = new Presentation(); ppt.loadFromFile("AddSignature.pptx"); //判定文档是否签名 boolean digitalSigned = ppt.isDigitallySigned(); if (digitalSigned == true) { ppt.removeAllDigitalSignatures();//移除签名 } //保存文档 ppt.saveToFile("RemoveSignature.pptx",FileFormat.PPTX_2013); ppt.dispose(); }}
04、
完成代码 后,运行程序,生成结果文档,在结果文档中可查看数字签名删除情况,如图,原有签名已成功删除:
End