Thank you John. I really don't care very much about these OnValue and OffValue, except that there was a piece of bizzarre behavior that I used them to work around.
On some pdf viewers (like Preview on the mac), if you did not SPECIFICALLY set the value of the check box to the on vlaue string, the checkbox would appear unchecked even though in pdf box introspection would show it as being checked. So I had a hack workaround where, in addition to checking the checkbox I also set the value to the OnValue. The universe of pdf viewers is vast and disturbingly inconsistent and buggy. Thank you for your explanation. I found several places in the pdfbox 2.0 Javadoc that seem wrong. So it needs attention. thank you. On Thu, Jun 25, 2015 at 2:16 PM, John Hewson <[email protected]> wrote: > > > On 24 Jun 2015, at 13:20, Evan Williams <[email protected]> > wrote: > > > > 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. > > > > 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. > > > > I am trying to get my application to work with pdfbox 2.0. Getting the > > forms I have to fill was pretty straightforward. > > > > But I am having some difficulty with the introspection. > > > > 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. > > > > 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. > > > > 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. > > The getOnValue() and getOffValue() APIs were removed because there’s no > need for them. The on value of a checkbox is always “Yes” and the off value > is always “Off”. These correspond to COSName.YES and COSName.OFF. > > I don’t know why these methods still show in the JavaDoc, as they were > removed some time ago… the JavaDoc must be stale. > > — John > > > If anyone can help me with the RadioButton thing that would be a big > help. > > > > Thank you. > > -- > > *Evan Williams* > > Sr. Software Engineer > > [email protected] > > > > *www.ZappRx.com <http://www.zapprx.com/>* > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- *Evan Williams* Sr. Software Engineer [email protected] *www.ZappRx.com <http://www.zapprx.com/>*

