Skip to main content
erinb41405790
Participant
February 9, 2018
Question

Dialog box with event button?

  • February 9, 2018
  • 1 reply
  • 620 views

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?

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
February 9, 2018

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

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
erinb41405790
Participant
February 9, 2018

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.

Thom Parker
Community Expert
Community Expert
February 9, 2018

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.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often