Skip to main content
Participant
May 30, 2019
Answered

How can I export the content of pdf-forms into a .csv-file?

  • May 30, 2019
  • 2 replies
  • 9146 views

How can I export the content of pdf-forms into a .csv-file (using adobe acrobat pro DC, version 2019)? Thanks! T

This topic has been closed for replies.
Correct answer jane-e

try67  wrote

To export it as a CSV file you would need a script, but you can export it as a tab-delimited text file.

Follow these instructions: Collect and manage PDF form data, Adobe Acrobat

Hi

Under the heading “Merge exported data files to a spreadsheet” in your link, it opens in Excel as a .csv file called report.csv by default. You don’t need a script. (Your script may work even better — I know you are a master of scripts!)

To hjpa74533426 : just be sure not to overwrite “report.csv” the next time you do this. In the Prepare Form toolbar, you start with More > Merge Data Files into Spreadsheet.

~ Jane

2 replies

Participating Frequently
March 10, 2024

Unfortunately the answers so far don't really help to really answer the question.

What you really need to do in order to get a predictable CSV from your PDF form field data, having full control, is the following:

Create a JavaScript which you can start, for example, by using the "Option" area of a "Button". (All JavaScript-related information can be found here: https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html .)

Within this JavaScript, you iterate through all form fields using eg:

   for ( i = 0; i < this.numFields; ++i ) {
      theField = this.getField(this.getNthFieldName(i));
      // acquire eg the Field's name and value and write it to a string (9 = TAB; D = Return):

      myCSV = myCSV + theField.name + "\u0009" + theField.value + "\u000D";

      ...

   }

Then, you create a data object and have it exported, having opened a dialog window to let the user choose the CSV's location, eg like this:

   this.createDataObject("output.csv", myCSV);

   this.exportDataObject({ cName:"output.csv", nLaunch:"1"});

 

I hope you can get the principle and now tailor you CSV to your needs.

try67
Community Expert
Community Expert
May 30, 2019

To export it as a CSV file you would need a script, but you can export it as a tab-delimited text file.

Follow these instructions: Collect and manage PDF form data, Adobe Acrobat

jane-e
Community Expert
jane-eCommunity ExpertCorrect answer
Community Expert
May 31, 2019

try67  wrote

To export it as a CSV file you would need a script, but you can export it as a tab-delimited text file.

Follow these instructions: Collect and manage PDF form data, Adobe Acrobat

Hi

Under the heading “Merge exported data files to a spreadsheet” in your link, it opens in Excel as a .csv file called report.csv by default. You don’t need a script. (Your script may work even better — I know you are a master of scripts!)

To hjpa74533426 : just be sure not to overwrite “report.csv” the next time you do this. In the Prepare Form toolbar, you start with More > Merge Data Files into Spreadsheet.

~ Jane

try67
Community Expert
Community Expert
May 31, 2019

That's a good idea!