How to Create a Dynamic PDF Stamp from the PDF Creation Date
Question details
The user wants to configure a custom dynamic stamp in a PDF editor to display the source document's metadata creation date rather than the current system date and time.

- Product
- Adobe Acrobat / PDF Editors
- Device & OS
- not provided
- Scenario
- Creating custom dynamic stamps for document tracking and management.
- Observed behavior
- The standard dynamic stamp defaults to the current date and time, requiring a script modification to pull the original file creation date from the PDF metadata.
Ensure your PDF editor supports JavaScript for custom calculation scripts in form fields, and verify that the target PDFs actually contain valid creation date metadata.
Use a Custom JavaScript Calculation in the Stamp's Text Field
Add a specific JavaScript snippet to your dynamic stamp's text field to extract and display the source document's creation date.
Dynamic stamps in advanced PDF editors use form fields to generate text automatically. By replacing the default date script with a script that targets document metadata, the stamp will dynamically adapt to whichever document it is applied to.
Navigate to the stamp management tools in your PDF editor and either edit an existing dynamic stamp or create a new custom stamp design.
Insert a text field into the stamp where you want the creation date to appear, or double-click an existing date text field to open its Properties.
Go to the 'Calculate' tab in the text field properties. Select 'Custom calculation script' and enter the following code: event.value = event.source.source.info.CreationDate;
Save the changes to your dynamic stamp. Open a different PDF file that has known metadata, apply the new stamp, and verify that the document's original creation date is displayed.

Manage and Apply Stamps Easily with WPS PDF
If you need a straightforward way to review documents and apply standardized or custom stamps without writing complex JavaScript, WPS Office provides a robust, user-friendly PDF editor. You can effortlessly manage custom image and text stamps to streamline your workflow.
- 1. Open Your PDF: Launch WPS Office and open the PDF document you wish to review or stamp.
- 2. Navigate to the Comment Tab: Click on the 'Comment' tab on the top ribbon to access the annotation tools.
- 3. Select the Stamp Tool: Click the 'Stamp' icon to view a variety of preset stamps or choose 'Click to Add' to create a custom stamp with your own text or image.
- 4. Place the Stamp: Click anywhere on the document page to place your selected stamp, then resize or move it as needed before saving.

Frequently Asked Questions
Why does my dynamic stamp still show the current date?
This usually happens if the text field is still running a standard date script (like util.printd) or if the custom script wasn't saved correctly. Ensure the calculation script exactly matches 'event.value = event.source.source.info.CreationDate;' and that there are no conflicting formatting scripts.
What happens if the PDF has no creation date metadata?
If the document lacks CreationDate metadata, the stamp field will likely appear blank, show 'undefined', or display an error. You can modify your JavaScript to include an 'if' statement that falls back to the current date if the metadata is missing.
Can I format the metadata creation date to look differently on the stamp?
Yes, but because the raw metadata string includes time zone and exact seconds (e.g., D:20231024103000-05'00'), you will need to parse the string within your JavaScript before passing it to formatting functions like util.printd to achieve a clean MM/DD/YYYY format.




