Solved

Adobe Acrobat script for stamp issue

Posted on 2013-02-01
3
1,113 Views
Last Modified: 2013-02-02
I have a field on stamp that i am using this code for:

var cRtn = app.response ("ENTER SHAMROCK PART NUMBER");
event.value = cRtn;

It worked the first time but now I have 2 issues.  One being that anytime i go to the dynamic stamp list it automatically pops up the java pop up asking for part number. (this is before I can even select a stamp) Two the stamp does not show up after entering part number.  I am sure I am not using the correct code but i have tried many different ways and cant seem to get it to work.  As you can see I really just want to be able to enter a part number and place the stamp.  The stamp does have other dynamic fields.  I am attaching the stamp file as well.
ControlledCopyStamp.pdf
0
Comment
Question by:notasgoodasyou
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 38846756
I see you did run into a problem with your stamps...

The problem is that you need to limit when the stamp script is actually executed. You need to use a stamp script like this:

if(event.source.forReal && (event.source.stampName == "#EkwOt9ACueFSPMv-OqOo0C"))
{
    // for the "Revised" field
    this.getField("Revised").value = util.printd("mmm dd, yyyy", new Date());

    // for the "Text2" field
    this.getField("Text2").value = "By " + ((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name);

    // for the Text3 field (this field)
    var cRtn = app.response ("ENTER SHAMROCK PART NUMBER");
	event.value = cRtn;
}

Open in new window


I've attached a file with the script fixed.

The crucial point is that you need to know the stamp name, and you can find that by going to the page template interface (in Acrobat XI this is Tools>Document Processing>Page Templates. You will see all the stamps that are defined in your file in a syntax like this:
#SOMERANDOMTEXT=Stamp Name

Open in new window


In the code above, you need to use the #SOMERANDOMTEXT portion (just before the equal sign) in the conditional statement to see if you are running in the right context.
ControlledCopyStamp.pdf
0
 

Author Closing Comment

by:notasgoodasyou
ID: 38846894
Thank you for a much fuller explanation and all the help.  I should have done more testing before accepting my previous questions answer.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 38846905
You are welcome. You can always post a support request to have the other question reopened.
0

Featured Post

Are your AD admin tools letting you down?

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

Power PDF (http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index.htm) is the newest product from the Document Imaging division of Nuance Communications (http://www.nuance.com/). It is available in two editions — …
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

777 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