Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Adobe Acrobat Pro DC action javascript read from txt file.

BogdanFloares
Level 1
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
asutosh_jena
Correct answer by
Community Advisor
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
asutosh_jena
Correct answer by
Community Advisor
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