Solved

Custom Acrobat Stamp

Posted on 2014-11-18
4
325 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
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…

810 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