15 Replies Latest reply on Apr 17, 2015 8:00 AM by gkaiseril

    Help with Dynamic Stamp

    DebRif

      Hello

      I have created a dynamic stamp that I swear was working great this morning, but now odd things are happening. I am very new to this. Heres what i have done so far....

      I created the PDF for the stamp.

      I created the custom stamp in Adobe

      I went to the file where the stamp is kept by adobe and added the form field.

      I added this text in custom Calculation:

      var cResponse = app.response({

       

      cQuestion: "Enter the number to appear in the stamp.",

       

      cTitle: "Number",

       

      cLabel: "Number:"

       

      });

       

      if (cResponse == null) {

       

      event.value = "*NVALID*";

       

      }

       

      else

       

      event.value = cResponse;

       

      I save and close file.

       

      I go to my pdf. Hit the stamp icon, go down to dynamic stamps and in stead of a list showing of all the dynamic stamps it takes me right to this

      I enter what info i want, and the stamp never stamps.

       

      Any suggestions?

       

      thanks!!

        • 1. Re: Help with Dynamic Stamp
          George_Johnson MVP & Adobe Community Professional

          You need to add additional code so that the app.response code only execute when that particular stamp is actually being applied. For this you need to determine the stamp name. For more information, see: http://acrobatusers.com/tutorials/dynamic_stamp_secrets

          • 2. Re: Help with Dynamic Stamp
            DebRif Level 1

            How do i get to the console for the stamp?

            • 3. Re: Help with Dynamic Stamp
              George_Johnson MVP & Adobe Community Professional

              Ctrl+J

              • 4. Re: Help with Dynamic Stamp
                gkaiseril MVP & Adobe Community Professional

                Another way would be to open the stamp with Acrobat and look at the template name for the stamp. The characters before the "=" is the stamp's name.

                template name.jpg

                • 5. Re: Help with Dynamic Stamp
                  DebRif Level 1

                  Thanks for the suggestions.

                  Sadly, none of the above is working.

                  Ctrl+J does not work. I dont have all the options in my java list

                  I tried opening the stamp and finding the name but that didnt work either. 

                  • 6. Re: Help with Dynamic Stamp
                    DebRif Level 1

                    Maybe i should mention I have Adobe Acrobat XI Standard

                    • 7. Re: Help with Dynamic Stamp
                      gkaiseril MVP & Adobe Community Professional

                      Have you turned on the JavaScript console in the "Preferences"?

                       

                      You also might need to be out of the Form Edit mode to access the template object.


                      • 8. Re: Help with Dynamic Stamp
                        George_Johnson MVP & Adobe Community Professional

                        Unfortunately, Acrobat Standard doesn't provide a user interface or keyboard shortcut to get to the JavaScript console, which is really quite silly. It may not let you work with templates either. If you want to send me the file I'll be happy to fix it for you: acroscript at gmail dot com

                        • 9. Re: Help with Dynamic Stamp
                          DebRif Level 1

                          I finally found the file name. The template thing worked, i just needed to know where to go look for it

                          So now my problem is where /how does that info get inserted into the script?

                          Here's, what i did. You can see it isnt working by the error at the bottom

                          • 10. Re: Help with Dynamic Stamp
                            George_Johnson MVP & Adobe Community Professional

                            You have an extra quotation mark at the end of the stamp name.

                             

                            I would recommend changing that line of code to:

                             

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

                            • 11. Re: Help with Dynamic Stamp
                              DebRif Level 1

                              I am SO frustrated!! I can get the thing to work without the stamp "name" in it if the file is open on my computer while i am using it.

                              If i close the file and then try to use it, the question box pops without the stamp. No good

                              So i add the script with the stamp "name" and not only does it still not work and only pull up the question box, now the answer in my question box doesnt change anymore.

                              If I email you the stamp did you say you could fix it? Im about to give up

                              • 12. Re: Help with Dynamic Stamp
                                DebRif Level 1

                                After a few deep breathes and a little more research, I finally got it to work! AHHHH SUCCESS!!!!

                                Just in case any other newbie like me ever needs it....

                                 

                                var cAsk = "Enter Bulletin Number" ;

                                var cTitle = "Bulletin Number:  ";

                                if(event.source.forReal && (event.source.stampName == "#4-T8yKAAEuISpm9hHP0NdD"))

                                {

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

                                  event.value = cMsg;

                                  event.source.source.info.exhibit = cMsg;

                                }

                                 

                                Thank for all the help!!!!!

                                Im sure i will be back

                                • 13. Re: Help with Dynamic Stamp
                                  bennaudio Level 1

                                  To add more clarification to this super fun stamps game I've been trying to play for the better part of 2 or 3 days now, going to try to blurt this out quickly so I can get dinner.

                                  Here is a solution to adding all the stamps you used to have into new Acrobat (as the whole "just copy the file into the Roaming Acrobat Stamps folder" didn't do anything for me)

                                  in Acrobat, create a new custom stamp, with whatever, this results in the crazy file name in the user stamp folder.

                                  Take your old stamps file, rename it to this file name, (and put into the Title field of that acrobat properties the Name of the Stamps you'd like them to be contained under, this will be what shows up when you bring up the stamp tool.

                                  And the whole dynamic stamp gobblygook above with the #crapblahsputting name, do away with that to make java and forms easier by opening page templates and just going through and making sure the pages in your file are accounted for and if you have the #crazyname then change it to something like #KISS=Keep it Simple Stupid (the Keep it Simple Stupid, will be what shows up if you were to show Stamp Names in Acrobat) and now when you try to do other Forms Java scripting you can just say event.source.stampName == "#KISS" and life will be easier

                                  Also in the organize page menu drag the files around so they can be in a better order than just how you added them into Stamp originally.

                                  You can drag in new files to this stamp file as well in the future too, just be sure to go to the page templates and get that page a name, #KISS2=Keep it Simple Squared

                                  I hope this also saves someone the frustration of this Stamp world, I'm sure that now that I've FINALLY figured it out, Adobe will remove the feature.

                                  • 14. Re: Help with Dynamic Stamp
                                    gkaiseril MVP & Adobe Community Professional

                                    Just dragging what one thinks is a "stamp" file into the user stamp directory does not work unless one is copying an existing stamp file form a previous version of Acrobat or another installation of the stamp,

                                     

                                    There are requirements beyond just being a PDF. The gobbledygook name is actually a template name and is the PDF page being add to the stamps is not a template then Acrobat/Reader's manage stamps processing will convert the page to a template and provide a unique name. In earlier versions many users assigned their own names to the PDF pages being designed for use as stamp. Note the name must be unique, no duplicate names allowed between the application and user stamps.

                                     

                                    If one follows the instructions fully and in detail there should be no issue with using stamps.

                                     

                                    One should realize that stamps are one type of annotation and that remove them might mean the loss of annotations ore the depreciation of the feature.

                                     

                                    That brings up another point . Adobe does change the location of where various application files are located so it is important to read the changes and if one is going to modify the program have some understanding about the how the program level works at a level below the UI. This will require reading at least the what's new on new releases, and the update notices. It also is helpful to have some familiarity with Acrobat JavaScript.

                                    • 15. Re: Help with Dynamic Stamp
                                      gkaiseril MVP & Adobe Community Professional


                                      www.PDFscripting has a free download to add the JavaScript console to Reader and the script named JSDebugger.js will add a debugger button to Reader or Acrobat.