5 Replies Latest reply on Feb 9, 2018 12:22 PM by Thom Parker

    Dialog box with event button?

    erinb41405790

      I need to create an interactive dialog box that allows the user to select an image to be loaded as an icon into the stamp just before placement. Is this possible? Or can this be accomplished without a dialog box?

        • 1. Re: Dialog box with event button?
          Thom Parker Adobe Community Professional

          If you want a dialog, here's a tool for creating them

          ACRODIALOGS OVERVIEW

           

          However, the only way you are going to load an icon into a dynamic stamp is with a button field on the stamp. To do this all you really need is this code in your stamp script

           

          this.getField("ImageButton").buttonImportIcon();

           

          Of course you'll need to replace "ImageButton" with the name of your button field

          • 2. Re: Dialog box with event button?
            erinb41405790 Level 1

            So, when I have the button field loaded into the stamp, it only allows me to trigger the button event while I’m editing the stamp. The goal was to have it so that the stamp doesnt need to be edited every single time we need to update the icon. Is there a way to make that work or is the editing the Stamp the only way to do this?

             

            Thanks for the the quick response.

            • 3. Re: Dialog box with event button?
              Thom Parker Adobe Community Professional

              Well ok, it's a little more complicated than I said.   The import icon function will only work from a privileged context in a stamp.  It's been a while since I've done this

               

              So to do this you have to create a folder level function for loading the button icon with this function, then call that function from the stamp script.

              • 4. Re: Dialog box with event button?
                Thom Parker Adobe Community Professional

                Actually, going back and looking at work I've done in the past, its more complicated than I thought. The import icon functions don't work well in the stamp context, unless you already have the path. There might be a way around this. I'll get back to you.

                 

                You'll find more info about stamps here: PDF Stamp Annotations

                • 5. Re: Dialog box with event button?
                  Thom Parker Adobe Community Professional

                  So there is a solution to importing an image into a stamp. The "field.buttonImportIcon" function only works when the image file path is known. So the trick is to know the file path

                   

                  Allowing the user to perform a general search for an icon is an advanced task and beyond the scope of this forum. If your interested in a custom solution, then this is what I do. Send me a message from my user page on this forum.