Chapter 12: Protect your PDF
- Providing metadata
- Compressing en decompressing PDFs
- Encrypting documents
- Adding digital signatures
I am building code that will allow me to add a signature image (i.e. "Appearance") and a digital id to a signature field. The code works fine - if the signature field is large. If the signature field is not very big, the image (appearance) won't show up. However, when I add the image manually it does. I have looked for days and cannot figure out why this is the case. Below is an example of the code I'm using. Any idea why this doesn't work?
Thanks for a very useful book about PDF and iText.
I have a question about the WARNING statement in Section 12.3: "...For iText 5.0.x, the Bouncy Castle JARs are required. Later versions of iText can use different libraries."
Is the above statement still true? BouncyCastle does not currently appear to be fully compatible with JDK7 and so I was wondering if iText could be configured to use the built-in Sun provider for PDF encryption.
In Acrobate, there are 10 entries under Document Restrictions Summary in the security tab. I've looked at
PdfWriter and it would seem some of these settings are there. For example
ALLOW_PRINTING = 2052. However, the controls under Document Security don't seem to correspond with the entries entries in
Any pointer would be really appreciated.
Text: iText in Action, 2nd. ed.
OS: Windows 7, 64-bit SP 1
Listing: 12.11 pg. 391
I'm having problems reproducing the example in the 'Creating a Public-Key Encrypted PDF'. I created the self-signed certificate as explained in the text. However, I'm receiving the following runtime error when running the example:
Exception in thread "main" java.lang.NoSuchFieldError: data
I am trying to implement Digital Signature to sign a pdf document using iText and I like the digital signature be certified by https://www.cacert.org/. I have done the following steps so far:
1) created a keystore using the following command
keytool -genkey -alias signer1 -keyalg RSA -keystore signer1.keystore
2) Created a client certificate from the https://www.cacert.org using my email address and imported into the keystore created in the previous step by the following command:
One new component of the software we're working on provides the ability to look up a list of fields on an arbitrary pdf, and then write to them. I'm well aware that at the moment (as stated on page 390), any pdf that contains an owner password to unlock anything will throw an exception if you try to open it for writing. I'm well aware, also, how easy it is to rebuild from source unofficially and remove all the restrictions, but for obvious reasons, we don't really want to do that.
I want to encrypt a Reader enabled PDF without removing the usage rights. As described in the book, I use
PdfStamper in append mode, but I get a
DocumentException with the message "Append mode does not support changing the encryption status." What am I doing wrong?
Using iText, I've successfully created a document containing an empty signature field. Now I want to allow people to sign this document in Adobe Reader. I've read that I need to Reader enable my document, but I can't find how to do this using iText.
I was able to add an unsigned signature field using iText. However, I am unable to use the Adobe Reader X to sign it. Is there a way to enable this using iText?