2 Replies Latest reply on May 7, 2013 1:17 PM by Dzedimainas

    Filling text fields from one form to another

    Dzedimainas

      Hi all,

       

      Thank you for your time.

       

      I'm new to javascript, but I have a work project, which needs to be done sooner rather than later.

       

      I have a main pdf form "Form 1" (converted from a word document), which has several text fields that need to be copied to another form "Form 2". The rest of the fields on Form 2 will be filled by the user. Form 1 has a button, which opens Form 2. The idea is that Form 2 is not always needed, so the user has the option to print just Form 1. However, sometimes Form 2 is has to be printed as well. So far I have managed to get the button open Form 2, but I have no idea how to populate the appropriate fields.

       

      I've tried combining the two pdf to one, and it works, but it's not efficient in regards to printing. The forms are for printing only, not saving of the data entered.  

       

      Thanks for your help!

        • 1. Re: Filling text fields from one form to another
          gkaiseril MVP & Adobe Community Professional

          A form created with Acrobat can export to an FDF or XFDF file and that file can be imported into a different PDF and for the form fields with the exact same name and type, the data will transfer. Reader does not have the options to perform this action but you can add a button with the necessary script. On the distribution DVD/CD for Acrobat there are samples int he PFN folder. You are going to have to apply Extended Reader Rights to allow Reader to export and import FDF or XFDF data files.

           

          Importing and exporting form data in Acrobat by Dan Shea

          Developing with PDF Forms by Dave Wraight

           

          You could also use the app.openDoc method to open the other form and fill-n the form fields using JavaScript.

          • 2. Re: Filling text fields from one form to another
            Dzedimainas Level 1

            Thanks for your input and links.

             

            I'm using app.openDoc to open the other form and it works fine. However, I can't find a way to reference the textfields. Nothing I've tried works. I'm not sure if the code to fill in the fields should go in the mouse down event of the button or in the open doc event of the other form.

             

            I'm using Acrobat XI Pro.

             

            I would really appreciate a bit more help.

             

            Thanks again.