3 Replies Latest reply on Apr 24, 2015 2:36 PM by gkaiseril

    Possible JS question

    kingryan

      I made a acrobat stamp to stamp projects, but when I try to stamp something I get a ton of pop ups (for the check boxes). Is there a JS way of making it all in one fill able form or how does it work?

        • 1. Re: Possible JS question
          gkaiseril MVP & Adobe Community Professional

          A stamp without JavaScript should not have any pop-ups?

           

          Is this a dynamic stamp?

           

          If so what is you code?

           

          Did you test the basic code without the internal references for the stamp?

           

          Did you get any errors?\

           

          Tutorials about stamps

          • 2. Re: Possible JS question
            kingryan Level 1

            Yes this is a dynamic stamp.

             

            Here is what I have (this is a project I worked on and when I open the stamp I get a pop up)

             

            ******Getting actual file name***********

             

             

            event.value = event.source.stampName;

            console.printLn("Stamp Name: " + event.source.stampName);

             

             

            **********End*****************************

             

             

             

             

             

             

            *********PDF date pop-up script**********

             

             

            var cAsk = "Please Enter Date Filed:" ;

            var CTitle = "Document State for Stamp ";

            if(event.source.forReal && (event.source.stampName == "#f410hqPHa2mpbzBIfGR4vA"))

            {

            var cMsg = app.response(cAsk, cTitle);

            cMsg;

            event.value = cMsg;

              event.source.source.info.DocumentState = cMsg;

            }

             

             

            ************End********************

             

            Sorry I'm really new to coding and I got that code off of a tutorial.

            • 3. Re: Possible JS question
              gkaiseril MVP & Adobe Community Professional

              This code:

               

              event.value = event.source.stampName;

              console.printLn("Stamp Name: " + event.source.stampName);

               

              provides the actual name of the stamp which you will need for your next script since that script checks the above name against the stamp being used. Stamps are all loaded into memory and available to any open PDF so  some times one needs to ensure a script is being run for the correct stamp.

               

              var cAsk = "Please Enter Date Filed:" ;

              var CTitle = "Document State for Stamp ";

              if(event.source.forReal && (event.source.stampName == "[The Provided e Goes Here]"))

              {

              var cMsg = app.response(cAsk, cTitle);

              cMsg;

              event.value = cMsg;

                event.source.source.info.DocumentState = cMsg;

              }

               

               

              You might want to study Dynamic stamp secrets using JavaScript and Acrobat XI by Thom Parker