Get PDF checkbox status

Dear Aspose tech team,

We have a question regarding your product Aspose PDF for Java.

We have some forms with questions and multiple choice check boxes in PDF format. We’d like to know if your product can not only extract the texts of the question and all the multiple choice texts, but also indicate which check box the user checked.

Thank you very much.
Sonny Jiang
sjiang@ellumen.com

@sonnyjiang,

There are various ways to retrieve the text from source PDF document, including the regular expressions and rectangular region of the page. Please refer to these help topics: Extract text from PDF, Extract Paragraph from PDF, and Search and Get Text from Pages of a PDF Document

The checkbox list have child annotations, and we can get or set child annotation with ActiveState property of CheckboxField instance. Please try the code ad follows:
C#

Document doc = new Document("MyDocument.pdf");
CheckboxField cb = doc.Form["chkBox1_04"] as CheckboxField;
//To get/ set value of annotation you can check or fill ActiveState property
//of child annotation or of the field.
cb[2].ActiveState = "MJ"; //this affects only this annotation, making it checked
cb[3].ActiveState = "Off";