The following solution worked:
public static void addImage(PdfStamper stamper,AcroFields form,String field,String fieldValue){ try{ System.out.println("Field "+field); java.util.List<AcroFields.FieldPosition> photograph = form.getFieldPositions(field); if(photograph!=null && photograph.size()>0){ Rectangle rect= photograph.get(0).position;
calling the above method:
addImage(stamper, form, "CustomerSign", "E:/signature/signature.png");
where CustomerSign is AcroField
source share