Skip to main content
rajs91353029
Known Participant
June 5, 2020
Question

Export pdf form data to excel with button

  • June 5, 2020
  • 4 replies
  • 5702 views

I am new here and trying to post a query here. I have a pdf form with over 50 fields including signature box. I want to export the values as well as field names to excel sheet using javascript so when clicked a button, it creates a file and each field name goes to a new column and below that column in the row it's value also exported. I hope here are many experts who knows how to do it. I tried with other example but not satisfied with the result I wanted. Example attached what solution I expect from you. 

 

Thanks in advance!

 

Regards,

Royan

 

 

 

 

    4 replies

    Participant
    August 11, 2025

    Hi there!

     

    I can't help, but I'm actually having a very similar issue right now - did you get any information about how to make something like this work?

    Thom Parker
    Community Expert
    Community Expert
    August 11, 2025

    Jennifer,

        There is no built-in Acrobat tool or direct way with an Acrobat script to export data directly to an Excel file. There are however several partial solutions. Most of which are discussed in this thread. 

    To add to this discussion, here's a tool (paid for) that collects data for forms and appends it to an existing CSV

    https://www.pdfscripting.com/public/Data-Collection-Tool-Instructions.cfm

     

    There is also a 3rd party Acrobat plug-in for exporting data:

    https://evermap.com/AutoExtract.asp

     

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Thom Parker
    Community Expert
    Community Expert
    June 7, 2020

    You will need a custom script to do this. Find information and tools on scripting form data here:

    https://www.pdfscripting.com/public/Form-Data-Handling.cfm

     

    Contact me if you custom development. 

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    try67
    Community Expert
    Community Expert
    June 5, 2020

    You can do it using the built-in Export Form Data command. Select the output format as "text file" and it will generate a tab-delimited .txt file with exactly this structure, which you could then open in Excel. It won't include the details of the signature, though.

    rajs91353029
    Known Participant
    June 6, 2020

    Hi Try,

    Thank you for trying to provide the solution to my problem. I am attaching a screenshot which is not what I need. I wrote this.exportDataObject({ cName:'output.csv', nLaunch:'2'});  and the answer is like this. 

     

     

    try67
    Community Expert
    Community Expert
    June 6, 2020

    I don't understand. So you already have the data file saved as an attachment to the PDF file?

    Also, are you sure the values are comma-separated, and not tab-delimited? If the latter, the file extension should be txt, not csv.

    Bernd Alheit
    Community Expert
    Community Expert
    June 5, 2020

    You can use the exportAsText method of doc object.

    rajs91353029
    Known Participant
    June 6, 2020

    I already have a PDF form saved with filled in data or I can fill in later too. Field names are having underscore and values will be either space separated and there is a text box which will have more text lines. Is it not possbile to click on a button and then export the field names and values into Excel sheet? One more question, the field names are showing in ascending order in Excel file when exported from .csv file, not in the same order in which fields names already provided to the fields. I tried using the function this.exportAsText({ cName:'output.csv', nLaunch:'2'}); and I was able to get the result in .csv file which I then imported into Excel sheet, but that too ascending order. Thanks for your prompt reply. 

    Bernd Alheit
    Community Expert
    Community Expert
    June 6, 2020

     exportAsText has not the parameter cName and nLaunch