2 Replies Latest reply on Apr 12, 2016 5:34 AM by Karl Heinz Kremer

    import text delimited file into forms using a button

    shannonsivels

      Hello,

       

      I am miserably stuck. I am trying to have it to that when a user pushes a button on my form the pop of a file automatically happens to insert information into the form spaces automatically. This willl eliminate the need to have to go to forms, other form options, import info, change the file type to all, then select the file, then a pop up box appears with the choice selection. I would want it to just click the button and that pop up box with the choices appears. I believe I would have to write the javascript for this, but I am not sure where to start. Can someone please help me?

        • 1. Re: import text delimited file into forms using a button
          try67 MVP & Adobe Community Professional

          If you want the file-path to be specified in advance then this script has to be run from a privileged context, which basically means a script that is installed on the user's local machine. Otherwise the user will have to select the file each time they run it.

          • 2. Re: import text delimited file into forms using a button
            Karl Heinz Kremer Adobe Community Professional

            The JavaScript method you would use is Doc.importTextData() (see here for more information: Acrobat DC SDK Documentation). However, this will not work from a button (at least not without a script installed on every computer you want to use this function on): As you can see in the documentation, if you want to prevent the file dialog from coming up, this method requires a privileged context to work, which means that you will have to create  folder level script that executes this method in such a privileged context.

             

            Also, this will not work with the free Reader unless you can apply forms rights to the document (indicated by the "F" in the quick bar in the documentation).