I have to fill a certified PDF form with itext. This form has been built with Adobe Life Cycle and contains, among others, image fields (PushButtonField).
With Adobe Reader, I can fill all types of fields, without breaking the certification signature, including image fields.
With itext, filling other types of fields works just fine, but when I try to fill the existing image fields, it breaks the form certification. I tried different ways, without success.
Way 1:
AcroFields form = pdfStamper.getAcroFields();
form.setField(fieldName, b64EncodedJpegByteArray)
With this code, image is displayed in Adobe Reader, but certification signature is broken.
Way 2 :
AcroFields form = pdfStamper.getAcroFields();
PushbuttonField pb = form.getNewPushbuttonFromField(fieldName);
pb.setImage(Image.getInstance(jpegByteArray);
form.replacePushbuttonField(fieldName, pb.getField());
With this one, the certification is also broken and the image is not displayed in Adobe Reader any more...
Has anyone met this before?