QPDFを使用すると、次のように 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