Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check checkbox on iTextPdf?

Tags:

java

itext

how to check checkbox on iText?

form.setField("pt_gender_female", "On");
form.setField("pt_gender_female", true);

I did couple of trial and error but none of these worked. I searched but didn't find the perfect answer.

like image 858
Eleven Avatar asked Apr 15 '15 10:04

Eleven


Video Answer


1 Answers

String states[] = stamper.getAcroFields().getAppearanceStates("pt_gender_female");
form.setField("pt_gender_female",states[1]);

I tried the abode snipet. It checked the checkbox.

like image 150
Eleven Avatar answered Sep 22 '22 09:09

Eleven