views:

45

answers:

1

Find the field names of inputtable form fields in a PDF document? I have an editable PDF form that I'm trying to automate the entry of form fields into using python.

In order to do this I must know the "names" of the form fields in the FDF data to input.

See question for background: http://stackoverflow.com/questions/1890570/how-can-i-auto-populate-a-pdf-form-in-django-python

I don't need to find the names programaticaly from the PDF necessarily, just need to know what they are so if this is possible in Preview/Adobe/etc. PDF readers/editors that is sufficient.

+1  A: 

Previously asked. Have a look at pdftk's dump_data_fields.

katrielalex
I'm working only with the PDF file, not the XDF file. It's a different question.
MikeN
Sorry. The question I linked was edited *ex post facto*... there's a valid answer in there, though. And I think `dump_form_fields` still does what you want.
katrielalex
That should be `dump_data_fields`. Fail me.
katrielalex
That worked! Thanks.
MikeN
And then `re.findall( "(?<=FieldName: )[^\n]+", contents )` gives you the list of names!
katrielalex