itext7:pdf文件中的图像在延期签名中导致错误
因此,我已向PDF添加了图像。但是,当我使用延期签名与图像签署PDF文件时,它给出了错误“由于应用了Adobe Reader中的签名“ ”,该文档已被更改或损坏。删除图像可以解决此问题。
我尝试了不同的图像,不同的格式(png& jpg),不同的解决方案(解决方案1 & 解决方案2 )。但是有效的唯一解决方案是去除图像?
这是我尝试插入映像的实现(pre solution1& solution2代码):
Image pdfImg = new Image(ImageDataFactory.create("src/main/resources/image.png"));
pdfImg.setWidth(defaultPageSize.getWidth() / 4);
pdfImg.setHeight(defaultPageSize.getWidth() / 8);
pdfImg.setHorizontalAlignment(HorizontalAlignment.CENTER);
Document.add(pdfImg);
我要添加的图像是 this 。
有什么解决方案吗?
编辑1:
按照此处的要求是非签名 pdf和a
So I have added a image to pdf. But when I sign the pdf file with image using deferred signing, it's giving the error "The document has been altered or corrupted since the Signature was applied" in adobe reader. Removing the image solves this issue.
I have tried different images, different formats(png & jpg), different solutions(solution1 & solution2). But the only solution that works is the removal of image?
Here is the implementation I tried to insert image (pre solution1 & solution2 code) :
Image pdfImg = new Image(ImageDataFactory.create("src/main/resources/image.png"));
pdfImg.setWidth(defaultPageSize.getWidth() / 4);
pdfImg.setHeight(defaultPageSize.getWidth() / 8);
pdfImg.setHorizontalAlignment(HorizontalAlignment.CENTER);
Document.add(pdfImg);
The image I am trying to add is this.
Is there any solution to this?
Edit 1 :
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
签名确实不正确。
显然在计算文档哈希时出现了问题。嵌入的签名声称 PDF 的签名字节范围的哈希值是,
但实际上是
这样,因此,Adobe Acrobat 有理由假设发生了更改或损坏。
另外,您的证书路径似乎也存在问题。
The signature indeed is incorrect.
Apparently an issue occurred while calculating the document hash. The embedded signature claims the hash of the signed byte ranges of the PDF is
but it actually is
Thus, Adobe Acrobat has reason to assume an alteration or corruption.
As an aside, there also appear to be issues in your certificate path.