How to add an image to an AcroForm field?
Posted on StackOverflow on Apr 17, 2013 by Anil M
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 like this:
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.