Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D73C19459 for ; Wed, 23 Mar 2016 16:10:29 +0000 (UTC) Received: (qmail 74840 invoked by uid 500); 23 Mar 2016 16:10:26 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 74823 invoked by uid 500); 23 Mar 2016 16:10:26 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 74462 invoked by uid 99); 23 Mar 2016 16:10:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2016 16:10:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A9BD21804FB for ; Wed, 23 Mar 2016 16:10:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.321 X-Spam-Level: X-Spam-Status: No, score=-1.321 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zw8c-72kcl5O for ; Wed, 23 Mar 2016 16:10:19 +0000 (UTC) Received: from UCOL19PA10.eemsg.mail.mil (ucol19pa10.eemsg.mail.mil [214.24.24.83]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 3A6635FB09 for ; Wed, 23 Mar 2016 16:10:18 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,382,1454976000"; d="scan'208";a="108270142" Received: from edge-okcd02.mail.mil ([152.229.52.230]) by UCOL19PA10.eemsg.mail.mil with ESMTP; 23 Mar 2016 16:10:11 +0000 Received: from UTINHPAO4.easf.csd.disa.mil (152.229.52.167) by edge-okcd02.mail.mil (152.229.52.230) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 23 Mar 2016 16:10:10 +0000 Received: from UTINHPAN7.easf.csd.disa.mil ([169.254.2.178]) by UTINHPAO4.easf.csd.disa.mil ([152.229.52.167]) with mapi id 14.03.0266.001; Wed, 23 Mar 2016 16:10:10 +0000 From: "Strein, Mark C CIV USARMY TRADOC ANALYSIS CTR (US)" To: "users@pdfbox.apache.org" Subject: RE: How to bind distinct OnValues for checkbox group? Thread-Topic: How to bind distinct OnValues for checkbox group? Thread-Index: AdGFGqJ3SzZzKWUPSyWq8f8mZPQN+AAA1UIA Date: Wed, 23 Mar 2016 16:10:09 +0000 Message-ID: <66EADB711988B548BF66E844CFA4B7DB766624BF@UTINHPAN7.easf.csd.disa.mil> References: <3150AAD11835514A97F0A06E0F19152A2B7E38@DPRC-EXCH-P04.JCONMAIL.doj.gov> In-Reply-To: <3150AAD11835514A97F0A06E0F19152A2B7E38@DPRC-EXCH-P04.JCONMAIL.doj.gov> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [152.229.72.12] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sir, Try this: /** * Returns the PDCheckbox you want to update or check from the pdFi= eldList. * Note: One of our teams created a PDF form using 'Adobe FormsCent= ral developer'. * after interrogating the forms fields, some inconsistencies arose= with checkboxes/radiobuttons. *=20 * Here is a name of a radio button found in the form:=20 * "VIP_KUf6k4VfAA83KYq7*XLsiA.null" *=20 * When it is interrogated, it will appear twice in the interrogati= on list as: * "VIP_KUf6k4VfAA83KYq7*XLsiA.null =3D 0" * "VIP_KUf6k4VfAA83KYq7*XLsiA.null =3D 1" *=20 * To determine the state of the radiobutton you would use the form= : *=20 * pDFFileManager.getPDCheckbox("VIP_KUf6k4VfAA83KYq7*XLsiA.null","= 0").isChecked() *=20 * @param fullyQualifiedName * @return - PDCheckbox or null if not found */ public PDCheckbox getPDCheckbox(String fullyQualifiedName, String o= nValue) { PDCheckbox checkbox =3D null; for(int i =3D 0; i < pdFieldList.size();i++) { PDField field =3D pdFieldList.get(i); if(field instanceof PDCheckbox) { try { =20 if(field.getFullyQualifiedName().equalsIgnoreCase(full= yQualifiedName) && ((PDCheckbox)field).getOnValue().equalsIgnoreCase(onValu= e)) { checkbox =3D (PDCheckbox)field; break; } } catch(IOException e) { e.printStackTrace(); } } } return checkbox; } V/R, Mark Strein TRAC-FLVN Wargaming and Simulations Directorate Analytic Tools Division - Paving Crew Keeper of the Codes 913-684-9309 -----Original Message----- From: Wojack, Robert (USTP) [mailto:Robert.Wojack@usdoj.gov]=20 Sent: Wednesday, March 23, 2016 10:52 AM To: users@pdfbox.apache.org Subject: [Non-DoD Source] How to bind distinct OnValues for checkbox group? We have a client that provides us with interactive PDF forms for our app to= populate fields with user data. The problem is the client sometimes provid= es us forms with typos and mistakes and is not responsive about fixing them= . In this case, we are given an interactive PDF form that has a pair of Yes/N= o checkboxes. Unfortunately, when creating the PDF, the client bound both c= heckboxes to the same "On" value. As a result, when a user checks a box, bo= th of them get checked (additionally, when a user unchecks a box, they both= become unchecked). I can use PDFBox to open the file, find the PDCheckbox object in question a= nd list their On and Off values, but I can't figure out how to update the b= indings to distinct values. Is it possible to do this in PDFBox? If so, can= someone please provide some guidance? We are using PDFBox 1.8.8. We are not positioned to upgrade to 2.0.0. Thanks Bob Wojack CSRA International, Inc. Onsite Contractor for the Department of Justice Senior Tech Lead US Trustee= Program Onsite Email Address: Robert.Wojack@usdoj.gov Onsite Phone Number: TBD Cell#: (301)910-9975 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org