Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Checkboxes question

Sloey, James

2005-06-03


I can find a checkbox and it's current state but I am unable to put a
check in the box.
I'm using the code snippet below...

PdfReader reader = new PdfReader(template);
PdfStamper stamp = new PdfStamper(reader,
newFileOutputStream(pdffilename));
PdfContentByte overimage = stamp.getOverContent(1);
AcroFields form = stamp.getAcroFields(); // Get the form fields
Iterator field_names = getFieldNames(form).iterator();
while (field_names.hasNext()) {
 String field_name = (String) field_names.next();
 String [] field_states = form.getAppearanceStates(field_name);
 int field_type = form.getFieldType(field_name);
 if (field_type == AcroFields.FIELD_TYPE_CHECKBOX){
 
System.out.println("\nState:"+field_states[0]+"\nValue:"+field_states[1]
) ;
   // TODO Put a check in the box
 }
}

Thanks in advance for your help

Jim Sloey


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.