These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

is there any way i can read external text file using acrobat js?

gavin2u
Registered: Jul 3 2009
Posts: 76
Answered

Hi all,

In my recent pdf document manipulation, i encountered several problems, and I got much help from us ACUers. Thank you so much. :)

Now, i wanna import my external text file into pdf doc.

the text file looks like this,

Quote:

key
A
D
C
A
...

the first line of the text file is the column name, like a database field name.

I want to import the file as an array, or a string, or a db-like thing... etc, that I could pop up the content in it one by one, and use them in my next manipulation steps.

For instance, once the text file is imported successfully, I could pop up [b]A[/b], the first line content, and add it as an annotation content to a certain element in my pdf page, for example, an element in my page like this,

Quote:

some text goes here, [b](23)[/b] is just a test.

I'll try to add the annotation to [b](23)[/b], the text fragment above.

Any ideas would be much appreciated.

thanks.

-
gavin

My Product Information:
Acrobat Pro 9.1.3, Windows
gavin2u
Registered: Jul 3 2009
Posts: 76
any ideas?

Thanks again.
gavin2u
Registered: Jul 3 2009
Posts: 76
OK, this is a big trouble???

I find my way, as follows,

// use attachments instead console.println("\n"); var oFile = this.getDataObjectContents("test.txt");var cFile = util.stringFromStream(oFile, "utf-8"); console.println(cFile);