Solved

Adobe Acrobat script for stamp issue

Posted on 2013-02-01
3
1,150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
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…

690 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