2 Replies Latest reply on Jul 17, 2009 6:45 AM by RG-Tex

    Placing Form Fields at bookmarks

    RG-Tex

      Hi,

       

      I'am new to the forum and new to Adobe Acroform.

       

      I have a Word document with a few bookmarks (alternatively, I could use some special characters instead of bookmarks).

       

      I have converted this to a pdf. Now in the pdf, I have created some form fields and would like to place these at the specific bookmarked locations.

       

      For example, I have this simple code for a form field:

       

      var p = this.addField("frmFld1", "text", 0,
      [35, 150, 210, 180]);

       

      I hope someone can help me with a code to place the above field at a bookmarked location (sometimes in different pages).

       

      Thanks in advance, and much appreciate any suggestion.

        • 1. Re: Placing Form Fields at bookmarks
          try67 MVP & Adobe Community Professional

          Are the bookmarks pointing just to a page number, or to a specific location in the page?

          • 2. Re: Placing Form Fields at bookmarks
            RG-Tex Level 1

            Thanks for the inquiry Try67,

             

            The bookmarks are actually at  a few (fixed) locations on page1, and sometimes they are also on page2.

             

            These are actually 'form fields' (used for signature and date). There are at least 3 such pairs on page 1 and maybe a couple more (sometimes on page 2).

             

            In Word, we already have  other data fields brought in from a database. The document templates are then converted to an Acroform, ready for signatures. A 3rd party software brings in the signatures and date signed (all the field data types have to be 'form-fields').

             

            What we are trying to do is to automate the process so that once converted into Adobe, all that needs to be done is to click a command button.

             

            All the script needs to do is create the form fields (already accomplished), and then place them at those specific locations.

            We can use bookmarks or even some special character in Word where the fields need to be placed.

             

            I tried something like this with some help from the API, but that didn't work (the field wasn't created). What am I doing wrong?

             

             

            function searchBookmarks(bkm, nLevel, bkmName)

            {

            if ( bkm.name == bkmName ) return bkm;

            if (bkm.children != null) {

            for (var i = 0; i < bkm.children.length; i++)

            {

            var bkMark = searchBookmarks(

            bkm.children[i], nLevel + 1, bkmName);

            var p = this.addField("sig1", "text", 0, bkmName);

            if ( bkMark != null ) break;

            }

            return bkMark;

            }

            return null;

            }