How to Create a Dynamic Acrobat Stamp That Confirms Duplicate Entries
Question details
The user wants to configure a dynamic PDF stamp that requires users to input a filing number or date twice, compares the two entries for a match, and only displays the stamp if the entries are identical.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating a custom workflow where accuracy is critical, such as stamping official documents with filing numbers without typographical errors.
- Observed behavior
- The dynamic stamp needs a verification step utilizing JavaScript to prevent mismatched manual data entry when the stamp is applied.
Ensure you have Adobe Acrobat Pro or a PDF editor that supports JavaScript for interactive form fields and dynamic stamps. Basic familiarity with JavaScript is recommended.
Using Acrobat JavaScript to Verify Duplicate Entries
Add custom JavaScript to your dynamic stamp's calculation event to prompt the user twice, compare the inputs, and output the result if they match.
Dynamic stamps use custom calculation scripts to interact with the user at the exact moment the stamp is applied. By leveraging the app.response() and app.alert() methods, you can build an error-checking mechanism directly into the stamp workflow.
Design your stamp visually in a new PDF document and add text fields where the filing numbers or dates will appear (e.g., name them 'Number' and 'Number1').
Right-click the primary text field, select 'Properties', navigate to the 'Calculate' tab, and choose 'Custom calculation script'.
Enter the script to capture input by defining variables. Use code like: var v1 = app.response("Filing Number:"); var v2 = app.response("Confirm Filing Number:");
Write an if statement so that if (v1 != v2) app.alert("Those numbers are not the same!"); triggers an alert. Under the else condition, assign the values: this.getField("Number").value = v1; this.getField("Number1").value = v2;
Wrap your entire script in an if (event.source && event.source.forReal && event.source.stampName == "#MyTestStamp") block. Save the PDF into your Acrobat Stamps folder and test the dynamic stamp.

Easily Manage and Apply Custom Stamps with WPS PDF
While advanced JavaScript programming is required for dynamic logic in Acrobat, WPS PDF offers a streamlined, user-friendly interface to create, customize, and apply professional stamps to your documents in seconds.
- 1. Open your PDF in WPS Office: Launch WPS Office and open the PDF document you want to stamp.
- 2. Navigate to the Comment Tab: Click on the 'Comment' tab on the top ribbon, then select the 'Stamp' tool.
- 3. Create a Custom Stamp: Click 'Click to Add', choose whether to add a text stamp or a picture stamp, and design it according to your needs.
- 4. Place Your Stamp: Click anywhere on the document to apply your newly created stamp instantly and save the file.

Frequently Asked Questions
Why does my dynamic stamp prompt me multiple times before I place it?
This occurs if you do not include the event.source.forReal check in your JavaScript. Acrobat evaluates calculation scripts in the background (such as when building the stamp palette interface), which can trigger the prompts prematurely if not blocked.
Can I require the user to enter dates instead of numbers?
Yes, you can easily change the prompt text in app.response() to ask for a date. You can also add regular expressions (Regex) in your JavaScript to validate that the user's input strictly follows a specific date format like MM/DD/YYYY before stamping.
Where do I save my custom dynamic stamp file?
Custom stamps must be saved in the Acrobat Stamps folder. The path is typically located in your user AppData directory under Adobe\Acrobat\[Version]\Stamps. Saving the PDF file directly there registers the custom scripts.
Will dynamic JavaScript stamps work on mobile PDF readers?
Most mobile PDF readers, including the mobile versions of Adobe Acrobat, have limited or no support for complex JavaScript execution like app.response(). Dynamic and interactive stamps are best utilized in fully-featured desktop environments.




