• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom Dynamic Stamp - Pop's up twice & have to enter all fields twice - why!?

Community Beginner ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

I have successfully created a custom dynamic stamp with many custom Java script fields which pop up for you to enter the content which will be filled in to the stamp once placed 

 

The whole sequence has 6 pop ups where you enter the information, then when i go to drop the stamp in place on the document it calls up the whole sequence again, entering all the info a second time. Once comepleted the second time, the content is all correct and you can place it into the document but how do i stop having to do the process twice?

 

Also, the custom stamp won't enter on some scanned document the first attempt - why would this be? 

 

HELP! 

TOPICS
General troubleshooting , How to , JavaScript

Views

6.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 05, 2021 May 05, 2021

Stamp scripts are called several times for different reasons. For example, they are called everytime any stamp in the same stamp file is displayed on the stamp menu, or when a preview for any stamp in the stamp file, as well as when the stamp is actually placed. To only display popups when the stamp is placed, the stamp script has to be properly qualified. It also helps to name the stamp properly.  

You can read about it here:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

...

Votes

Translate

Translate
LEGEND ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

It's hard to say for sure without seeing the stamp file in question. If you can post it, we can take a look at it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

Thank you for replying.. post pictures or attach the stamp file itself?

 

Cheers! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

Attach the stamp file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

Please see attached! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

Where does you check the stamp name?

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/ 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

Sorry, where does the stamp name? You mean what is the name in the file location?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

Look at the link.

updated_figure_04.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

Stamp scripts are called several times for different reasons. For example, they are called everytime any stamp in the same stamp file is displayed on the stamp menu, or when a preview for any stamp in the stamp file, as well as when the stamp is actually placed. To only display popups when the stamp is placed, the stamp script has to be properly qualified. It also helps to name the stamp properly.  

You can read about it here:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 18, 2021 May 18, 2021

Copy link to clipboard

Copied

Hi Guys, 

I have followed and read these and this isnt helping - the stamp is still popping up 2 times. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2021 May 18, 2021

Copy link to clipboard

Copied

Have you changed the file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 19, 2021 May 19, 2021

Copy link to clipboard

Copied

Yes, i tried changing file and its name etc. 

I got on to adobe chat support. I posted - 

ME:

For each of the text fields, i have entered script into the custom calulcation script - 
eg. this.getField("Date Received").value = app.response("Date Received:");

ADOBE:

So I was testing by creating the same stamp at my end, in case if we need to do something in the application to correct it. As after applying the script it does pop up twice.
When use the general event.value = util.printd(); script. It works okay

 

I tried to change the script as per above and it made the stamp pop ups not come up any more to input the fields. 

 

The 6 seperate scripts in the stamp are:

 

this.getField("Date Current").value = app.response("Date Current:");

this.getField("Date Received").value = app.response("Date Received:");

this.getField("Cost Centre").value = app.response("Cost Centre:");

this.getField("Purchase Order Number").value = app.response("Purchase Order Number:");

this.getField("Budget Line Item").value = app.response("Budget Line Item");

this.getField("Amount").value = app.response("Amount");

 

Thanks in Advance! 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2021 May 20, 2021

Copy link to clipboard

Copied

You doesn't check the stamp name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2021 May 20, 2021

Copy link to clipboard

Copied

You are missing some key information. This article covers everthing you need to know:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2021 May 20, 2021

Copy link to clipboard

Copied

In the "Stamp Secrets" article it explains that the stamp script needs to be qualified with a special event property and the stamp name, in order to only run when the stamp is placed.  Read the artcle and follow the instructions. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 19, 2021 May 19, 2021

Copy link to clipboard

Copied

Can you post the stamp code? We need to actually see what you are doing.

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 19, 2021 May 19, 2021

Copy link to clipboard

Copied

Thanks Thom, please see above! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

Hi bobbieb56686240! Did you find the answer? I have the same question and have read through all of this! 😞 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

The solution is to properly qualify the script that display the stamp popup, so that it only displays when the stamp is actually being placed. The code for doing the qualification is discussed in these articles, take a look and let us know what part you do not understand:

 

For Members: https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

Free : https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

I cant find where I am going wrong:

Here is my Script:

if((event.source.forReal)&&(event.source.stampName == "#Contractors"));
this.getField("CO0210").value=app.response("Contractor #:");
this.getField("LN0210").value=app.response("Contractors Last Name:");
this.getField("CN0210").value=app.response("CLIENTS NAME:");
this.getField("INV0210").value=app.response("FULL INVOICE NUMBER:");

 

I have attached the file as well. Any help would be greatly appreciated 🙂 -Dena

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

Also, here is the stamp name:

templates
[object Template="#Contractors=WeeklyTimesheet"]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

What happens when you use the stamp?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

You have to enter through the cycle and then it appears to go through the cycle again for it to stick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

You must test the stamp name. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2021 Dec 09, 2021

Copy link to clipboard

Copied

LATEST

There is an error in the script. Here's the correction.  An "if" statment does not end with a semicolon, instead it is the start of a code block, which is delimited with curly brackets.  

 

if((event.source.forReal)&&(event.source.stampName == "#Contractors"))
{
  this.getField("CO0210").value=app.response("Contractor #:");
   this.getField("LN0210").value=app.response("Contractors Last Name:");
   this.getField("CN0210").value=app.response("CLIENTS NAME:");
   this.getField("INV0210").value=app.response("FULL INVOICE NUMBER:");
}

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines