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

Export values and append them to an existing csv file

Community Beginner ,
Apr 25, 2022 Apr 25, 2022

How can I create a button to export the values of the form and append them to an existing CSV file?

TOPICS
How to , JavaScript , PDF forms
1.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
1 ACCEPTED SOLUTION
Community Expert ,
Apr 29, 2022 Apr 29, 2022
LATEST

There's no fix. Reader can't create new data objects, unless a very special (and expensive) right is applied to the file.

View solution in original post

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 ,
Apr 26, 2022 Apr 26, 2022

There's no built-in command that will do it in Acrobat. You will need to write a custom-made that reads the CSV file, adds to it the new values, and then exports it as a new CSV file, which the user will then have to manually select in order to overwrite the original.

If you're looking for a more automated solution it would be better to do it outside of Acrobat. For example, a stand-alone tool could do it without problem.

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 Beginner ,
Apr 26, 2022 Apr 26, 2022

Thank you for the assistance. Can you suggest to me what tool can fulfill our requirement?

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 ,
Apr 27, 2022 Apr 27, 2022

It will have to be custom-made, I think. If you're interested in hiring a professional to create it for you feel free to contact me privately to discuss it further.

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Finally, I have worked out the following code, but I got the error in Adobe Reader DC. However, it is fine in the other PDF tool such as PDF-XChange Editor. Do you know how to fix it in Adobe Reader DC?

Coding

var filenameonly =  this.documentFileName;
filenameonly=filenameonly.replace(/\.pdf|\.ai/gi, "")
var arrayfield = new Array("Text2","Text4","Check Box3","Dropdown1");
var fieldValues = [];
for (var i = 0; i <arrayfield.length; i++)
fieldValues.push(this.getField(arrayfield[i]).value);
this.createDataObject(filenameonly+'.csv', fieldValues.join());
this.exportDataObject({ cName:filenameonly+'.csv', nLaunch:'1'});

 

Error 

NotAllowedError: Security settings prevent access to this property or method.
Doc.createDataObject:7:Field Button4:Mouse Up

 

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 ,
Apr 29, 2022 Apr 29, 2022
LATEST

There's no fix. Reader can't create new data objects, unless a very special (and expensive) right is applied to the file.

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