Open the selected PDF and convert it.
PdfReader reader = new PdfReader(fileNameIn); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(fileNameOut)); AcroFields form = stamper.getAcroFields();
Inspect the objects of the form Fields> Keys> View results to find the string value of the flag, in my case it is "Check Box1"
String[] checkboxstates = form.GetAppearanceStates("Check Box1");
Check the checkboxstates variable. [0] = value not verified, [1] = value verified. Then to check it out
fields.SetField("Check Box1", "checkboxstates[1]")
source share