I\'m trying to fill PDF using acrofields, I\'m able to add string data perfectly, but having issues in adding images to acrofields. This is my code for adding string data..
The "official" way to do this, is to have a Button field as placeholder for the image, and to replace the "icon" of the button as described in my book:
PushbuttonField ad = form.getNewPushbuttonFromField(imageFieldName);
ad.setLayout(PushbuttonField.LAYOUT_ICON_ONLY);
ad.setProportionalIcon(true);
ad.setImage(Image.getInstance("E:/signature/signature.png"));
form.replacePushbuttonField("advertisement", ad.getField());
See ReplaceIcon.java for the full code sample.
DISCLAIMER: I'm the original developer of iText and the author of the "iText in Action" books.