3

I use itext 's setField function to save field value into pdf form, but I find after I use itext, the whole pdf will corrupt, you can not edit the pdf in adobe reader any more. It will show you that the file has been changed and extended feature in adobe reader can not be used.

So I am looking another library that can do the same job. another problem: after I signed the pdf with identity card, if I try to edit the pdf using itext library, it will invalidate all the previous signature. but if I use acrobat the edit the fields, all signature revisions are kept well.

Is there any similar library that I can use to do the above things ?

MemoryLeak
  • 7,322
  • 23
  • 90
  • 133

3 Answers3

2

Take a look at Apache PDFBox.

dogbane
  • 266,786
  • 75
  • 396
  • 414
1

According to http://support.itextpdf.com/node/6 you need to fill out your form in append mode in order to preserve Reader's extended features.

I don't have any answers for the signatures though.

Andrew Cash
  • 2,321
  • 1
  • 17
  • 11
0

This may not be iText's fault. You may need to resign the document. Acrobat was probably doing this for you automatically, as it had the original certificates. When you modify a field, you modified the document. The signatures were not meant for the modifications.

BZ1
  • 1,306
  • 2
  • 8
  • 10
  • if you use acrobat to modify the pdf, it will ask you to validate all signatures, but not just invalidate them. – MemoryLeak Jan 11 '11 at 08:21
  • When you modify a document, the hash changes and signatures become invalid. This is working as defined. Signatures are meant as a defense against tampering. If you wish to modify the document and also keep the signatures valid, then you need to re-sign the document. iText is a library. It will do what you tell it to do. Acrobat is an application. It has been made to be user friendly. – BZ1 Jan 11 '11 at 11:01