【发布时间】:2013-01-19 17:55:24
【问题描述】:
我有一个pdf document,我正在用 pdfbox 解析它。文件没有加密,我可以打开文件。但是,以下 PDFBox 中的代码行
try
{
document = PDDocument.load( inpFilename);
if( document.isEncrypted() )
{
System.err.println( "Error: Document is encrypted with a password." );
return;
}
产生错误:"Error: Document is encrypted with a password."。知道为什么会这样吗?是否有各种 pdf 加密(允许您阅读,但不能使用 pdfbox 处理)?
【问题讨论】:
-
添加,pdfimages可以对pdf进行操作,创建图片。
-
能够打开文档,例如在 adobe reader 中并不意味着文档未加密。不幸的是,我手头只有手机,无法检查您的 PDF,但我猜您的文档是使用默认用户密码加密的...
-
您的链接在最初工作时允许下载两个文档,AN9780300883.pdf 和 b303635a.pdf,您对哪一个有问题?前者不加密,后者加密!