Adobe Acrobat Pro DC action javascript read from txt file. | Community
Skip to main content
June 2, 2021
Solved

Adobe Acrobat Pro DC action javascript read from txt file.

  • June 2, 2021
  • 1 reply
  • 1355 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

Hi @bogdanfloares 

 

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

 

Thanks!

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
June 3, 2021

Hi @bogdanfloares 

 

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

 

Thanks!