Link to home
Start Free TrialLog in
Avatar of Genius123
Genius123Flag for United States of America

asked on

Custom Acrobat Stamp

Hello,  

I built a custom stamp that prompts me for a number.  Here is the code:

 

So when I go to select the custom stamp, the prompt box appears, but it never allows me to select the actual stamp.  Now here's how I can get it to work.  If I open the stamp pdf file and leave it in Forms Editing mode, then go back to my other PDF, it allows me to choose the stamp, drop it into workspace, then it prompts me for a number.  This works, however, I can't just leave the other PDF stamp file open all the time.

Thanks,
Joel
var cResponse = app.response({
cQuestion: "Enter Revision Number",
cTitle: "Revision Number",
cLabel: "Revision Number:"
});
if (cResponse == null) {
event.value = "*NVALID*";
}
else
event.value = cResponse;

Open in new window

Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Can you please share your complete stamp file. Did you define the stamp as a page template? You will have to use the stamp's internal name in your calculation script, otherwise the popup will be shown at different times, even when you are not trying to place your stamp.

The correct way of doing this is by using code like this:

if (event.source.forReal && (event.source.stampName == "#MyTestStampABC")) {
	var cResponse = app.response({
		cQuestion: "Enter Revision Number",
		cTitle: "Revision Number",
		cLabel: "Revision Number:"
	});
	if (cResponse == null) {
		event.value = "*NVALID*";
	} else
		event.value = cResponse;
}

Open in new window


You have to make sure that the stamp name is the same that you use for the page template name. Just in case you don't know, the stamp template name needs to something like this:

#InternalStampName=The user facing name

Open in new window


Here is a tutorial for creating custom stamps: http://acrobatusers.com/tutorials/dynamic_stamp_secrets
Avatar of Genius123

ASKER

Hi,

I'm not sure how to get the name of my stamp.  Can you please help?  I've attached the file.

Thanks for your help.
0FF9-OlEfUEO3Rowo8V4kC.pdf
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.  That worked perfectly!