Solved

Adobe Acrobat script for stamp issue

Posted on 2013-02-01
3
1,100 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

747 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

12 Experts available now in Live!

Get 1:1 Help Now