Joel F.
Joel F.

Reputation: 59

Set Selected Dropdown Value in PDF from FDF File

I have an editable PDF with defined fields that I have been saving to using a FDF file with PDFtk. All works fine, except I now I need to select a dropdown value and cannot see how to select one. Here's the field data extracted from PDFtk.

FieldType: Choice
FieldName: Dropdown1
FieldFlags: 131072
FieldValue:  
FieldValueDefault:  
FieldJustification: Left
FieldStateOption:  
FieldStateOption: Active
FieldStateOption: Active - Works as Needed
FieldStateOption: Casual
...

Here's the snippet of the FDF I have created:

<</T(Text Field 11)/V(Good)>>
<</T(Dropdown1)/Opt [(Active - Works as Needed)]>>
<</T(Text Field 23)/V(15000.00)>>

I have tried:

<</T(Dropdown1)/Opt [(Active - Works as Needed)]>>
<</Opt [(Active - Works as Needed)]>>

But when I load the PDF, the dropdown hasn't a value selected. What should the line look like so the saved PDF will have the proper value (FieldStateOption) selected?

Any help is appreciated.

Upvotes: 0

Views: 362

Answers (1)

Jan L&#243;pez
Jan L&#243;pez

Reputation: 13

I would do:

<</T(Text Field 11)/V(Good)>>
<</T(Dropdown1) /V (Active - Works as Needed) /Opt [(Active - Works as Needed)]>>
<</T(Text Field 23)/V(15000.00)>>

You just have to set a /V (value) with the same text.

Upvotes: 0

Related Questions