Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing "pdftk my-pdf-form.pdf dump_data_fields" shows nothing

Tags:

pdftk

I am using the tool pdftk, I have got a editable PDF and I saw in the documentation the arguments dump_data_fields should show me the fields of the form.

I use this command (windows): pdftk my-pdf-form.pdf dump_data_fields

I am using the pdftk server edition.

Documentation: https://www.pdflabs.com/docs/pdftk-man-page/

The point is that the PDF is editable, it has got fields to write with Adobe PDF Viewer.

like image 566
dlopezgonzalez Avatar asked May 20 '15 12:05

dlopezgonzalez


3 Answers

The problem was that the pdf was created by Adobe LiveCycle Designer and was save as "Adobe Dynamic XML From". The solution is saving the file as "Adobe Static PDF Form". Possibly pdftk cannot deal with that livecycle files.

like image 117
dlopezgonzalez Avatar answered Sep 29 '22 07:09

dlopezgonzalez


I thought the accepted answer might have been my solution, but it turned out the PDF document I was working with actually didn't have form fields set up. If the document looks like a form, but the form fields are not greyed out, then no fields will be detected.

The only way I could solve this was to open the document in Acrobat Pro and add the fields via its form tool. Then pdftk worked fine.

like image 37
guero64 Avatar answered Sep 29 '22 07:09

guero64


If you are facing the problem of the OP within the Windows environment, follow the below instructions.

1- Open the GUI PDFtk program. (You may also use the cli if you wish)

extracting pdf fields using pdftk on Windows

2- Click on the "Add PDF..." button and search for your fill-ready PDF file.

extracting pdf fields using pdftk on Windows

3- Scroll down to the bottom of the GUI PDFtk window and click on "Create PDF..." without adding or changing any settings.

extracting pdf fields using pdftk on Windows

4- Save the new fill-ready PDF file with a new name to a directory of your choice

extracting pdf fields using pdftk on Windows

5- Finally, issue the Windows version of the dump_data_fields command using cmd, like so.(notice how "output" is used instead of ">")

extracting pdf fields using pdftk on Windows

6- Open the text file "fields.txt", and you will see the field names. Example shown below.

extracting pdf fields using pdftk on Windows

like image 36
Full Array Avatar answered Sep 29 '22 07:09

Full Array