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 12B7418C0C for ; Thu, 25 Jun 2015 16:41:08 +0000 (UTC) Received: (qmail 62765 invoked by uid 500); 25 Jun 2015 16:41:07 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 62742 invoked by uid 500); 25 Jun 2015 16:41:07 -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 62731 invoked by uid 99); 25 Jun 2015 16:41:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jun 2015 16:41:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [213.133.104.168] (HELO www168.your-server.de) (213.133.104.168) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jun 2015 16:38:52 +0000 Received: from [88.198.220.131] (helo=sslproxy02.your-server.de) by www168.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.80.1) (envelope-from ) id 1Z8ACe-00014V-Fv for users@pdfbox.apache.org; Thu, 25 Jun 2015 18:40:40 +0200 Received: from [79.242.110.109] (helo=mbp001.fritz.box) by sslproxy02.your-server.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1Z8ACa-00074G-0P for users@pdfbox.apache.org; Thu, 25 Jun 2015 18:40:37 +0200 From: Maruan Sahyoun Content-Type: multipart/alternative; boundary="Apple-Mail=_45595092-7138-4DD0-AC00-5D56D862F33D" Message-Id: <52816D5D-299D-4BFE-8E14-D8FCF10D6151@fileaffairs.de> Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Going from 1.8.9 to 2.0 Date: Thu, 25 Jun 2015 18:40:27 +0200 References: <77A5D0D4-1FA4-4571-8699-E56229C066B0@fileaffairs.de> To: users@pdfbox.apache.org In-Reply-To: X-Mailer: Apple Mail (2.2098) X-Authenticated-Sender: sahyoun@fileaffairs.de X-Virus-Scanned: Clear (ClamAV 0.98.5/20610/Wed Jun 24 22:41:10 2015) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_45595092-7138-4DD0-AC00-5D56D862F33D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, > Am 25.06.2015 um 16:23 schrieb Evan Williams = : >=20 > When I said getOptions() returned null I meant it returns empty list. = Not > enough coffee. Everything else applies. I've created https://issues.apache.org/jira/browse/PDFBOX-2841 = to handle that. - getOptions() returns the export values of the radio button group so = that's not what you are looking for (and we might rename that method to = better reflect it's intention) - you could use getWidgets() to get the individual radio buttons and = from there for each individual widget = widget.getAppearance().getNormalAppearance() gives you the dictionary to = get the values from. BR Maruan >=20 > On Thu, Jun 25, 2015 at 10:07 AM, Evan Williams = > wrote: >=20 >> Absolutely you can! >>=20 >>=20 >> = https://drive.google.com/file/d/0B9TQWtr2Ipa9YlRORHVlTDVGS0k/view?usp=3Dsh= aring >>=20 >> But I strongly, strongly suspect that it is nothing to do with the = pdf >> document itself because there are many many forms from many many = sources >> and they all exhibit the same behavior. >>=20 >> In the linked document I was, for example, able to enumerate 'Male' = and >> 'Female' as values for the Radio Button group 'Gender' with my 1.8.9 = code. >> In my 2.0 code I can't. >>=20 >> The way I used to enumerate radio button groups was to call the = getKids() >> method an the radio collection and enumerate the returned fields. = That is >> not possible in 2.0 and I don't have anything that works. the = PDButton >> method goetOptions() always returns null. >>=20 >> Thank you! >>=20 >> On Thu, Jun 25, 2015 at 2:02 AM, Maruan Sahyoun = >> wrote: >>=20 >>> Hi, >>>=20 >>>> Am 24.06.2015 um 22:20 schrieb Evan Williams = >>> : >>>>=20 >>>> I have an application written to use pdfbox 1.8.9 which is all = about >>>> filling forms. I have a form library and I fill in values in forms = using >>>> data I am handed. >>>>=20 >>>> One of the things I also need to do is do introspection on the pdf >>> document >>>> to find out what fields are in it and make a template for filling = the >>> form >>>> with data in my application. >>>>=20 >>>> I am trying to get my application to work with pdfbox 2.0. Getting = the >>>> forms I have to fill was pretty straightforward. >>>>=20 >>>> But I am having some difficulty with the introspection. >>>>=20 >>>> For the templates I like to have an enumeration of the possible = values >>> of >>>> the field if the field has such values. For example the names of = the >>>> possible values for a collection of radio buttons. >>>>=20 >>>> I understood how to get those values for the 1.8.9 = PDRadioCollection >>> but I >>>> have tried various things to get the same information for the 2.0 >>>> PDRadioButton and I am not getting the information I need. the >>> getOptions() >>>> method on PDButton looked like exactly what I needed. But it always >>> returns >>>> null for me. >>>>=20 >>>=20 >>> could you upload a sample form to a public location to take a look? >>>=20 >>> BR >>> Maruan >>>=20 >>>> As an aside I also used to get the on and off values of checkboxes = with >>>> getOnValue() and getOffValue(). These are in the Javadoc but appear = to >>> not >>>> be in the actual API. I don't care very much about those, but they = were >>>> nice to have, and the Javadoc should be accurate as much as = possible. >>>>=20 >>>> If anyone can help me with the RadioButton thing that would be a = big >>> help. >>>>=20 >>>> Thank you. >>>> -- >>>> *Evan Williams* >>>> Sr. Software Engineer >>>> evan.williams@zapprx.com >>>>=20 >>>> *www.ZappRx.com * >>>=20 >>>=20 >>> = --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >>> For additional commands, e-mail: users-help@pdfbox.apache.org >>>=20 >>>=20 >>=20 >>=20 >> -- >> *Evan Williams* >> Sr. Software Engineer >> evan.williams@zapprx.com >>=20 >> *www.ZappRx.com * >>=20 >>=20 >=20 >=20 > --=20 > *Evan Williams* > Sr. Software Engineer > evan.williams@zapprx.com >=20 > *www.ZappRx.com * --Apple-Mail=_45595092-7138-4DD0-AC00-5D56D862F33D--