The following code works for me: PdfReader r = new PdfReader("c:\\136311_F.pdf"); PdfStamper stp = new PdfStamper(r, new FileOutputStream("c:\\test.pdf")); AcroFields af = stp.getAcroFields(); String[] apps = af.getAppearanceStates("Product"); af.setField("Product", "SecureIndex7"); stp.close(); PdfReader r2 = new PdfReader("c:\\test.pdf"); AcroFields af2 = r2.getAcroFields(); System.out.println(af2.getField("Product"));
The field "Product" is a single field, it makes no sense to look for what box lights with what value. It can be done without much work but it's low level work and it would only give you the box coordinates. Paulo ----- Original Message ----- From: "Prosperity Software" <[EMAIL PROTECTED]> To: <itext-questions@lists.sourceforge.net> Sent: Thursday, August 30, 2007 6:01 PM Subject: Re: [iText-questions] Same named checkboxes and export values > Here is the PDF we are working with. The problem is with the field named > "Product" We are trying to use the AcroFields.setField method. When we > try > to get the export values, the array comes back null, however we can get > the > appearance states. The problem is, what appearance state corresponds to > which checkbox named "Product"?? > > On 8/30/07, Paulo Soares <[EMAIL PROTECTED]> wrote: >> >> Sometimes checkboxes can be use as radio buttons but the export value >> will >> only be one per named field. Without seeing one of those PDFs we can only >> guess. >> >> Paulo >> >> ----- Original Message ----- >> From: "Prosperity Software" <[EMAIL PROTECTED]> >> To: <itext-questions@lists.sourceforge.net> >> Sent: Thursday, August 30, 2007 5:05 PM >> Subject: [iText-questions] Same named checkboxes and export values >> >> >> > We have a ton of fillable PDFs that we are trying to fill, and we are >> > running into a problem with the checkbox sets where are the checkboxes >> > have >> > the same name, but we can't retrieve the export values!!! >> > >> > Is there an easy way to tell the PDF which checkbox to mark if there >> > are >> > more than one checkbox with that name?? We tried getting the export >> > values >> > or appearance values that correspond to that particular field name, but >> it >> > doesn't seem that there is a particular order that these values come >> back >> > in. >> > >> > Any help would be greatly appreciated!! ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/