使用QPDF,您可以轻松地从PDF文件中删除限制/加密,如下所示:
我已经尝试使用
示例文档:
https://issues.apache.org/jira/secure/attachment/12514714/in.pdf
qpdf --decrypt infile outfile
我希望在Java中使用PDFBox做同样的事情:
PDDocument doc = PDDocument.load(inputFilename);
if (doc.isEncrypted()) {
// remove the encryption to alter the document
}
我已经尝试使用
StandardDecryptionMaterial
,但不知道所有者密码是什么。QPDF是如何做到这一点的?示例文档:
https://issues.apache.org/jira/secure/attachment/12514714/in.pdf