Solved

Custom Acrobat Stamp

Posted on 2014-11-18
4
313 Views
Last Modified: 2014-11-19
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

0
Comment
Question by:Genius123
  • 2
  • 2
4 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 40452365
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
0
 

Author Comment

by:Genius123
ID: 40452604
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
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 40452635
To get the name of the stamp, bring up the page template dialog (Tools>Document Processing>Page Templates):

Page Templates Screenshot
As you can see, the template name is in the format I've indicated earlier: The part on the left is the stamp name (you can also rename it in the Page Templates dialog). In your case, this would be #JvnMllljsbC...psA

You can also get the name of a stamp by applying the stamp, then selecting it and running the following code in the JavaScript console:

this.selectedAnnots[0].AP;

Open in new window

0
 

Author Closing Comment

by:Genius123
ID: 40452701
Thank you.  That worked perfectly!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now