Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Adobe Acrobat Pro DC action javascript read from txt file.

Avatar

Level 1

I tried to reed from txt in a button action javascript like that:

 

this.importDataObject("test.txt", "C:/Users/user/Desktop/test.txt");
var i = this.getField("rand").value;
var oFile = this.getDataObjectContents("test.txt");
var cFile = util.stringFromStream(oFile, "utf-8");
console.println(cFile);
var lines = cFile.split('\n');

 

I get this error:

RangeError: Invalid argument value.
Doc.importDataObject:1:Field Read:Focus

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @BogdanFloares 

 

Please post this question in https://community.adobe.com/t5/acrobat/bd-p/acrobat for faster response.

 

Thanks!

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @BogdanFloares 

 

Please post this question in https://community.adobe.com/t5/acrobat/bd-p/acrobat for faster response.

 

Thanks!