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

Export pdf form data to excel with button

New Here ,
Jun 04, 2020 Jun 04, 2020

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

 

 

 

 

5.0K
Translate
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

You can use the exportAsText method of doc object.

Translate
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

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. 

Translate
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

 exportAsText has not the parameter cName and nLaunch

Translate
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

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.

Translate
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

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.pngexpand image

 

 

Translate
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

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.

Translate
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

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. 

Translate
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

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

Translate
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
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

Translate
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