Dialog box with event button?

New Here ,
Feb 09, 2018

Copy link to clipboard

Copied

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?

TOPICS
Acrobat SDK and JavaScript

Views

87

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Dialog box with event button?

New Here ,
Feb 09, 2018

Copy link to clipboard

Copied

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?

TOPICS
Acrobat SDK and JavaScript

Views

88

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 09, 2018 0
Adobe Community Professional ,
Feb 09, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 09, 2018 0
New Here ,
Feb 09, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 09, 2018 0
Adobe Community Professional ,
Feb 09, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 09, 2018 0
Adobe Community Professional ,
Feb 09, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 09, 2018 0
Adobe Community Professional ,
Feb 09, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 09, 2018 0