Skip to main content
Participant
July 21, 2023
Question

Importing .txt script working... but not at all.

  • July 21, 2023
  • 3 replies
  • 504 views

Hi all,

 

I also take time to check to see if my question has been answered but I cannot find anything that matches the issue that I am having.

 

I am using this:

this.importTextData();

 

to prompt the user to select the .txt file to import into a fillable pdf document. There are no errors that appear and by the looks of it it works fine. However no data actually imports. Here is the strange thing, if i do the import process manually (Prepare Form -> More -> Import -> change to text files (*.txt) and select the exact same file I tried to in the this.importTextData(); process it works with out any issues and all the data imports.

 

So I know it is not an issue with the .txt file and that the Text Field Properties Names are fine. Is there something that is wrong with the "this.importTextData();" that is incorrect? 

 

Any help would be great. Thanks all in advance. 

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
July 21, 2023

Are you testing it in Acrobat, or in Reader? For the latter a special right has to be applied to the file first, which I don't believe you can do with just Acrobat.

Bernd Alheit
Community Expert
Community Expert
July 21, 2023

Look at the Javascript console (ctrl-j).

Nesa Nurani
Community Expert
Community Expert
July 21, 2023

Where do you use script?

It needs to be run from privileged context.

Participant
July 21, 2023

Thanks Nesa for the prompt reply.

 

I have it in a button on the pdf fillable form. This could very well be the issue.

 

Is there an easy fix?