PDF 加密
作者:互联网
引库
implementation 'com.tom-roush:pdfbox-android:2.0.6.0'
第二步 复制代码
PDDocument document = PDDocument.load(file);
AccessPermission ap = new AccessPermission();
StandardProtectionPolicy spp = new StandardProtectionPolicy(pass, pass, ap);
spp.setEncryptionKeyLength(128);
spp.setPermissions(ap);
document.protect(spp);
document.save(path);
document.close();
第三步 测试
然后下班回家
标签:加密,spp,new,ap,PDDocument,pass,PDF,document 来源: https://blog.csdn.net/Dream_xiangxiang/article/details/121769459