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

Creating Dynamic Stamp Error

New Here ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

Hi,

 

I am trying to create a 'Paid' stamp using Acrobat. I have read the 'Dynamics Stamp Secrets' website, but to no avail. Here is what I am going for (when stamp is placed):

04b7f0357a114084318447336a1aa388.png < Typable Reference #.

 

And this is the Java script for the 'Reference': 

ef5bd1a1c356fe46f7d584725743518b.png

 

When I place the stamp, the date appears, but there is no JavaScript Pop-up for me to type my Reference Number. Help would be greatly appricated! 

TOPICS
General troubleshooting , JavaScript , PDF forms

Views

6.4K

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 2 Correct answers

Community Expert , May 28, 2021 May 28, 2021

Ok, so never use the Acrobat Stamp tools.  I've stated this repeatedly in many of the articles and video tutorials I've created on stamps. These tools destroy all dynamic content and create a completely different static stamp. 

And there is no option for creating a dynamic stamp in Acrobat. 

 

After adding fields and scripts to a stamp to make it dynamic, you have to manually copy the stamp file into one of the two Acrobat Stamp folders.  

 

Watch the free videos on stamps here:

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

...

Votes

Translate

Translate
Community Expert , May 29, 2021 May 29, 2021

Hi,

You must modify the name of the template, something like that: #myStamp=PaidStamp

... and your script: if(event.source.forReal && event.source.stampName == "#myStamp")

Then that's working fine!

You can change myStamp by anything else as long as it's the same in the template and in the script.

@+

Capture_d’écran_2021-05-29_à_19_58_14.pngCapture_d’écran_2021-05-29_à_19_58_52.png

Votes

Translate

Translate
Community Expert ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

First, remove the "event.source.source.info" line. This was an example in the article of how to access properties of the document being stampped. It's not necessary for operation.

 

However, what is necessary is the correct stamp name.  Have you verified this? 

Here is a video tutorial on how to find the stamp name:

https://www.pdfscripting.com/public/images/Video/FindingStampName.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
New Here ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

Hello,

 

Thank you for your response, I have editted as you directed. It still does not work, and I have noticed that when I place the stamp it does not work. The name was actually incorrect, and I have updated it. Here is the updated code. 

d5b6f077f6c774aa79111b3571deb081.png

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 27, 2021 May 27, 2021

Copy link to clipboard

Copied

There is nothing wrong with your stamp code. If the stamp name is correct, then  the code will work.

 

Another thing that will cause problems is if there is a copy of this same stamp in a different file or in the other stamp folder. Make sure there is one and only one stamp with this name.

 

Can you post the stamp file?  It would make it easier to debug. 

 

One other thing you can do to debug this is to put this line of code a  the top of the stamp script. It will display the stamp name in the console window. This does two things, 1) it shows that the stamp script is running. And it verifies the stamp name you are using in the 'if'

 

console.println("Stamp:" + event.source.stampName);

 

Tell us what appears in the console window.

 

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 ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

Hello,

 

Here is the file like you asked for. 

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 28, 2021 May 28, 2021

Copy link to clipboard

Copied

First, the "console.println" line has a syntax error.  JavaScript is case sensitive, so the "s" in "stampName" must be lower case: "event.source.stampName"

 

Then, the stamp name in the script is incorrect.  You must have changed it to "PaidStamp".  Which is fine, but it has to be prefixed with a "#" symbol if you want the stamp script to execute when the stamp is placed. This was covered in the Stamp Secrets article. 

 

Fix these and your script is good to go.

 

 

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 ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hi,

 

I have done everything as you directed. It isn't working on my side. There was previously different versions of this stamp being created, I deleted them just to be sure it wasn't the issue. I think it might be how I am uploading the stamp. 

 

When I go to test my stamp, I click the floppy disk icon, then use the custom stamps tool to create a dynamic stamp.

 

I tried to download the PDF on a different computer, and use the stamp tool as normal. It still does not work.

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 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Ok, so never use the Acrobat Stamp tools.  I've stated this repeatedly in many of the articles and video tutorials I've created on stamps. These tools destroy all dynamic content and create a completely different static stamp. 

And there is no option for creating a dynamic stamp in Acrobat. 

 

After adding fields and scripts to a stamp to make it dynamic, you have to manually copy the stamp file into one of the two Acrobat Stamp folders.  

 

Watch the free videos on stamps here:

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
New Here ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hello Thom,

 

I have done exactly as you have directed. I read through the entire 'Installing Stamps' page on your website, and followed this video. I have installed the PDF that I sent you to the C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\plug_ins\Annotations\Stamps folder. 

068997c9784d2d1c56a80f8226af01b9.png

 

When I login to Acrobat, it does appear as a folder called 'Paid Stamp.xlsx. It has my stamp in it,  but when I place it the stamp name doesn't popup in the console when I place the stamp, but rather, the codes runs when I enter the program.

 

Thanks for your help.

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 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Have you looked in the Console Window to see if there are any reported errors? and to see the results of the "console.println" code you put into the stamp script?

 

You'll find a tutorial on the Console Window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

 

 

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 29, 2021 May 29, 2021

Copy link to clipboard

Copied

LATEST

Hi,

You must modify the name of the template, something like that: #myStamp=PaidStamp

... and your script: if(event.source.forReal && event.source.stampName == "#myStamp")

Then that's working fine!

You can change myStamp by anything else as long as it's the same in the template and in the script.

@+

Capture_d’écran_2021-05-29_à_19_58_14.pngCapture_d’écran_2021-05-29_à_19_58_52.png

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