Apache pdfbox 声称 PDF 文档已加密(但事实并非如此!)- 修复了吗? [英] Apache pdfbox claims that PDF documents are encrypted (but they are not!) - fix?

查看:93
本文介绍了Apache pdfbox 声称 PDF 文档已加密(但事实并非如此!)- 修复了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的程序中,我正在下载杂项.PDF 文档,最后我想使用 Apache pdfbox (v1.8.8) 将它们合并为一个组合文档.出于某种奇怪的原因,PDFMergerUtility 未能声称文件已加密 - 显然它们不是!我可以在 Adob​​e Reader 和其他 PDF 查看器中打开它们,没有任何问题,也无需提供任何密码.

In my program I am downloading misc. PDF documents and at the very end I want to merge those into one combined document using Apache pdfbox (v1.8.8). For some strange reason the PDFMergerUtility fails claiming that the files are encryped - which they are obviously not! I can open them in Adobe Reader and other PDF viewers without any issue and without having to provide any password.

Java 异常和堆栈跟踪读取:

The Java exception and stack trace reads:

Feb 28, 2015 6:25:54 PM org.apache.pdfbox.pdfparser.PDFParser parse
INFO: Document is encrypted
Failed to merge all files into downloaded\page merged.pdf: Error: source PDF is encrypted, can't append encrypted PDF documents.
java.io.IOException: Error: source PDF is encrypted, can't append encrypted PDF documents.
    at org.apache.pdfbox.util.PDFMergerUtility.appendDocument(PDFMergerUtility.java:284)
    at org.apache.pdfbox.util.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:241)
    at org.apache.pdfbox.util.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:194)
    at mmo.pull_ct.PullCT.mergePDFs(PullCT.java:481)

有人遇到同样的问题和/或知道修复方法或解决方法吗?这是在 Windows 8.1 (x64) 下使用 Java (1.)8.

Anybody having the same issue and/or maybe knows a fix or work-around? This is using Java (1.)8 under Windows 8.1 (x64).

推荐答案

由上面 Tilman Hausherr 和 mkl 的评论回答.文件加密,但使用的是空密码.尝试让我前进.再次感谢!

Answered by the comments from Tilman Hausherr and mkl above. The Files were encrypted but using an empty password. Trying that got me going. Thanks again!

这篇关于Apache pdfbox 声称 PDF 文档已加密(但事实并非如此!)- 修复了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆