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

Export pdf form data to excel with button

New Here ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

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

 

 

 

 

Views

4.0K

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 ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

You can use the exportAsText method of doc object.

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

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. 

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

 exportAsText has not the parameter cName and nLaunch

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 ,
Jun 05, 2020 Jun 05, 2020

Copy link to clipboard

Copied

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.

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

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. Screenshot_3.png

 

 

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

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.

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

Yes, 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. 

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 ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

If you want to define the order of the fields then you have to generate the file using a script.

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 ,
Jun 07, 2020 Jun 07, 2020

Copy link to clipboard

Copied

LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

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