【问题标题】:How to check pdf is protected using itext in java如何在java中使用itext检查pdf是否受到保护
【发布时间】:2014-03-31 07:28:13
【问题描述】:

我正在使用 itext 库来了解 pdf 文件是否受到保护。 我还将 boncycastle 库添加到我的类路径中,但它仍然显示错误:

Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.DEREncodable
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more

【问题讨论】:

标签: java pdf itext


【解决方案1】:

把这个库放在你的类路径bcprov-jdk15on-1.47.jar

更新

根据您使用的 IText 版本注意您的充气城堡依赖项版本。使用 Maven 存储库仔细检查它。例如。 herehere

【讨论】:

  • +1;但请检查 maven pom 以获得首选的 Bouncy Castle 版本。例如。 5.5.0 版记录了对 BC 1.49 的依赖。
猜你喜欢
  • 2013-03-31
  • 2015-11-29
  • 2023-03-26
  • 1970-01-01
  • 1970-01-01
  • 2016-02-19
  • 2012-06-08
  • 1970-01-01
  • 2019-07-01
相关资源
最近更新 更多