سؤال

I'm trying to read pdf form. I managed to get normal textbox value by doing this.
Code

PdfReader reader = new PdfReader(RESULT1);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(RESULT2));
AcroFields form = stamper.getAcroFields();
String name = form.getField("Text1");//Check Box 1
System.out.println("Name "+name);

How do I get check box value. Please advice.

هل كانت مفيدة؟

المحلول

As Bruno said in his comment, you should be able to get the value of a check box with the code you posted. You can use form.getAppearanceStates(NAME_OF_CHECKBOX) to get a String array of possible values. For a check box, these should be Off and Yes.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top