Hi,

Am 18.10.2012 17:34, schrieb engineering:
HI

I am really hoping somebody can help me out here.

I am trying to get data  from a Drop down field in a PDF.

I have code such as:


//Test for Drop Down List
if
(className.equals("org.apache.pdfbox.pdmodel.interactive.form.PDChoiceField"))
{

String fullName2 = field.getFullyQualifiedName();

mypartialName = field.getPartialName();
myLabel = field.getAlternateFieldName();
String data = field.getValue();

System.out.println(myLabel);
}


I can get information such a Label with the Drop down -- which is awesome -- but
is there a way to get a comma separated string value of the values in the drop
down.
Hmm, there is no simple getter (yet) to get that information. Following the pdf spec (chapter 12.7.4.4) you should try something like this:

COSArray options = (COSArray)field.getDictionary().getDictionaryObject( COSName.OPT );

I didn't test it.

Any help would be appreciated.

Thxs!!


BR
Andreas Lehmkühler

Reply via email to