• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

extracting all form fields from a fillable pdf

New Here ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Is there any way of extracting/exporting/copying all form fields from a pdf? Meaning, the wordings from all the fields so I can pass it along to another individual to use for cross referencing, since they are not able to see all the various form fields within the split screen?

Thanks!!!

Views

65.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 04, 2020 Nov 04, 2020

Or run this code from the JS Console:

 

console.clear();
for (var i=0; i<this.numFields; i++) {
	var fname = this.getNthFieldName(i)
	var f = this.getField(fname);
	if (f==null) continue;
	console.println(fname);
}

 

Votes

Translate

Translate
LEGEND ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Can you clarify exactly what you want to extract (e.g., field names, field values, the fields themselves, etc.) and in what form you want to deliver them to the other person?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

The person that needs this is looking for the entire running list of all the fillable field names within the pdf. Any kind of document that I can deliver them in, I am willing to take suggestions.

Right now, what I was thinking of doing was having the screen split between the pdf and the listing of field names in the sidebar and taking screen captures as I scroll down the pdf and corresponding field names in the sidebar until I got all pages.

Is there an email address I could contact you at to discuss offline? I have an example I could send you but don't want posted online.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

The easiest way would be to export a form to a spreadsheet. You do this in Acrobat 9 by selecting: Forms > Manage Form Data > Merge Data Files in to Spreadsheet. This will export the form data into a CSV file. The first row will contain the field names, the order of which depends on which version of Acrobat you're using. In 9, it's alphabetical order. You can remove any subsequent rows that contain the form data, and the other person can transpose the row of field names to a column of field names.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Thanks, I will give that a shot! I appreciate your responses to my question!!!!! Happy Holidays George.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

I developed a tool that lists all the form fields in the file, and their

data, to the console, from where they can be easily copied to an Word file,

or just a plain text file. This tool will work in both Acrobat and Reader,

while other options will only work in Acrobat.

Have a look here:

http://try67.blogspot.com/2011/11/reader-display-form-data.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 03, 2020 Nov 03, 2020

Copy link to clipboard

Copied

This is an old thread and George_Johnson already has provided the most important required information:  How to extract the field names from a PDF form and copy them into a spreadsheet document.  From that point, he very reasonably assumed others already would know how to use Excel to convert (“transpose”) that horizontal row of cells containing the field names into a vertical column of cells with those field names in the correct order to make it easier to just print them all out. 

 

Unfortunately, I didn’t happen to already know how to “transpose” in Excel, but it didn’t take long to figure it out.  Suspecting there may be others who are similarly limited, I felt it might be useful to save them a bit of time and post the few additional steps necessary to end up with a text list of all the fields in a PDF form.  

 

BTW - Although another poster provided a link for purchasing a tool to accomplish this (and much more), it seemed like an awfully expensive way to end up with just a list of those field names, which is a chore one might need to do just once or only rarely.  So I decided to do it myself starting with Mr. Johnson’s excellent information.

 

Also, I need to mention that I don’t think this can be accomplished using just the Acrobat Reader (I don’t have it, so I can’t be certain).  What I have is Acrobat Pro 2017 and I imagine Acrobat Pro DC probably works about the same for doing this.  So just be sure you’re using a product with the necessary capabilities.  (The steps below also assume your system has at least Excel installed; Word optional). 

 

In Item 1., below, I’ve detailed the steps I used in applying Mr. Johnson’s information.  In Item 2. I’ve described the additional steps for a couple of ways to end up with the list I wanted:

 

  1.          With the PDF form open in Acrobat Pro, click on the “View” menu, then click on “Show/Hide” and make sure the “Tools Pane” is marked to display.  Then click on “Tools” (just under the main Menu, to the right of “Home”), then select “Prepare Form” from the Tool Pane (on the right side).  You’ll see in the bottom part of the Tool Pane a list of all of the fields in that PDF form.  Just above that list (and above the “FIELDS” title word), find the word “More” that has a dropdown indicator to its right.  Click on that dropdown indicator, then select “Merge Data Files into Spreadsheet”.  On the next screen, click on “Add Files”, then navigate to the location for the same PDF form file that‘s already open (I know; this seems repetitively silly), then click once on that filename & then click on “Open”.  On the next screen, click on “Export”, then pick the location and a name for this .csv spreadsheet file, then click on “Save”.  On the next screen, click on “View File Now”.  This should open that new file in Excel and you should see all of the field names listed across the top row and the next row down will display the source file name.  From here, you have at least two optionsYou can transpose the data in Excel (then just print it), or you can copy the data into Word if (like me) you’ll be more comfortable dealing with it there.

 

  1.         Transpose the data in Excel.  Easy to do, but watch out for “where” you put it.  Click on the “1” just to the left of the first row to select (highlight) that entire row of the spreadsheet, then copy it (right mouse click & select “Copy”).  Next, click once in any blank cell in that first column (e.g., A3), then right mouse click again, and (under “Paste Options”) select the fourth paste option (hover over it & it should say “Transpose”).  That should cause all of those field names to be listed vertically in the same order.  [It’s important to select a blank cell to start the vertical list or you’ll overwrite some (though not all) of the existing data in those first two rows.]

 

  1.         Copy the data into Word.  (Starting in the new spreadsheet from the point where all of the fields are listed across in the first row):  Click on the “1” on the far left of the first row to select (highlight) that entire row of the spreadsheet, then copy it (right mouse click & select “Copy”).  Next, open a new (blank) document in Word, then paste the copied data into this new document as just text (right mouse click & select the last Paste option – the one with a “T” in the image).  Now, all the field names are on the new Word document page separated by tabs.  From this point, you have more options:  You can easily create a vertical list of those field names [open Word’s Replace feature and type “^t” (w/o parentheses) in the “Find what:” box and “^p” (w/o parentheses) in the “Replace with:” box, then click on “Replace All”.  All of the fields will be listed vertically on the page in the correct order].  Or you can put them all into a one-column table [highlight the copied material, then click on “Insert”, then “Table”, then “Convert Text to Table”, and on the next screen, set the number of columns as “1”, make sure it’s set to separate at Tabs, then click on “OK”].  Of course, if the number of fields takes up too much vertical space in the document, whether they’re all formatted as just a vertical list or in a single column table, you can highlight the entire list (or table), then click on Layout, select Columns and make it a multi-column list to make better use of the page while still keeping all of the fields in their original order. 

 

I hope someone finds some of all this useful.

 

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2020 Nov 04, 2020

Copy link to clipboard

Copied

Or run this code from the JS Console:

 

console.clear();
for (var i=0; i<this.numFields; i++) {
	var fname = this.getNthFieldName(i)
	var f = this.getField(fname);
	if (f==null) continue;
	console.println(fname);
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 05, 2020 Nov 05, 2020

Copy link to clipboard

Copied

Try67 -

 

Thanks a lot!  I'll "try to try" that. 

 

I do hope I can make it work, but - perhaps like a few other users - I'm not a programmer & really don't know what the Java Console is or can do.  Something new to learn, I guess.  

 

Thanks! 

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

Try67-

 

Undoubtedly, you are FAR more advanced than I and likely more so than many others.  I've looked for -- but could not find -- a "JS Console" within Excel.  I unsuccessfully looked through all the menus on the ribbon and didn't find a reference to it, so I searched for "js console" in Excel under both "Help" and "Show Training" and got no results.  Next, using Google, I searched on "2020 excel where is "JS console?" and still didn't find results that seemed to explain anything about how to get to it.  

 

Can you provide a simple explanation for how to get to the "JS Console" and then how to "run code" from it? 

 

I'm sure pieces of code (such as what you posted) are more efficient than all the steps I did without "code", but I just don't even know how to get to where I can try doing it.  However, I'm definitely curious and eager to learn!

 

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

Use the Javascript console in Acrobat :

ctrl-j or cmd-j 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

The JS Console is in Acrobat, not Excel... To view it press Ctrl+J.

Then paste the code above into its lower part, select all of it with the mouse and press Ctrl+Enter to run it.

Before running it will look like this:

 

try67_0-1605634188034.png

 

 

And afterwards it will be something like this:

 

try67_1-1605634206557.png

 

These are the names of all the fields in the file (except for the last line, which will probably be "true").

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

Thank you very, very much!  I'm glad to learn it wasn't something in Excel that I should have found!  

 

Following your instructions and using your code, it all worked like a charm!  

 

I certainly apologize for my ignorance and misunderstanding! 

 

FWIW, after I read George_Johnson's original suggestion, I read your 12/22/2011 post and followed your link.  For a one-time use, the price seemed high to me for what I assumed would be just automating the Transpose function in Excel, so I decided to figure out Transposing in Excel myself.  However, now that I've gone back and re-read it all, I see that your 12/22/2011 post referenced "both Acrobat and Reader" and that the title at the linked page says "Custom-made Adobe Scripts", so I guess I really should have figured out back then that your suggestion was a complete alternative to what George_Johnson hadsuggested and would require starting over in Acrobat.  Instead, I incorrectly assumed your suggestion picked up at the point George_Johnson's suggestion had stopped . . . with the user still in Excel.  

 

Thanks so much for the clarification and for the very valuable new information!

 

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

BTW - 

I did notice that the field list generated by your code was not ordered in the same sequence as those same fields are displayed on the list in the "Prepare Form" Tool in Acrobat Pro.  Is there a reason for this?  Does it make any difference for anything? 

 

Thanks,

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Paul,

I've been to countlee Excel classes and never shown the Transpose function! I clicked into  your thread to search the solution for getting all my field names listed, then got a bonus as the transpose function will help me with a totally different task! Thank you so much for the careful step by step guidance!

Ken

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

Ken -

You're very welcome and I'm pleased to know I could help.

Paul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

Thanks Paul!  I did find this very useful.  You probably saved a couple of hours of extra work for me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2023 Jul 27, 2023

Copy link to clipboard

Copied

LATEST

@pdaltonlaw   Thank you this is the best solution!!!! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 18, 2021 Feb 18, 2021

Copy link to clipboard

Copied

Is there a way to programmatically perform "Merge Data Files in to Spreadsheet" to a lot of files? I checked out adobe pdf tool api, but it does not seem to support that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

No. You can collect the data from multiple files as a part of an Action and then export it with a script, but that's more work than simply using the built-in command, I think...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines