我在项目中添加了适用于android的itext for android库,一切正常,但当我使用gradle lint构建项目时,会生成以下错误:
InvalidPackage: Package not included in Android
../../libs/itextg-5.5.3.jar: Invalid package reference in library; not included in Android: java.awt. Referenced from com.itextpdf.text.pdf.BarcodeCodabar.
../../libs/itextg-5.5.
我尝试了下面的代码来读取pdf:
val byteArrayOutPutStream: ByteArrayOutputStream = new ByteArrayOutputStream
val file = new File(path + name)
val inputStream = new FileInputStream(file)
val document = new PDFDocumentReader(inputStream)
var result: List[BufferedImage] = Nil
val numPgs = document
我有一个用数字证书签名的pdf文件。签名后不得更改pdf (表单域)的内容。应该允许添加签名。现在,第二个人需要添加他的数字签名。之后,不允许对文档进行更多更改。如何做到这一点? 我能够通过java和pdfbox创建一个pdf,对其进行签名,并使用java检查证书是否有效,以及证书是否用于对文档进行签名。在stackoverflow上,我看到了下面的代码片段,它将签名添加到已经签名的pdf中,但我不知道如何实现它。 for (int i = 1; i < 4; i++)
{
load current version of the PDF;
apply the i
我使用的是apache pdfbox 2.0.21。 当我尝试执行下面的代码时,它抛出了像数字格式异常这样的错误。 Exception in thread "main" java.lang.NumberFormatException: For input string: "1#1"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
异常:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.reflect.InvocationTargetException
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
请帮助我,这是我第一次使用签名的pdf。我想用证书签署一个pdf,但是它会抛出我所写的错误,我正在使用itext-5.0.5在netbeans8.2 (JAVA)中开发一个桌面应用程序。我读过一些关于依赖关系和版本的文章,我真的不知道如何解决这个问题。我很感激你的帮助,如果你能一步一步地向我解释,那就太好了。谢谢
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DERObject
at com.itextpdf.text.pdf.PdfSignatureAp
嗨,所以我试图使用FOP将一个xml文件转换成pdf,并且我不断地遇到错误,现在我有了错误。
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlgraphics/io/ResourceResolver
at org.apache.fop.apps.FopConfParser.<init>(FopConfParser.java:122)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:132)
at
当我试图验证已签署的pdf文档时,我得到了RuntimeException:
Exception in thread "main" java.lang.RuntimeException: algorithm identifier 1.2.398.3.10.1.1.1.1 in key not recognised
at org.bouncycastle.jce.provider.JDKKeyFactory.createPublicKeyFromPublicKeyInfo(Unknown Source)
at org.bouncycastle.jce.provider.X509C