PDF Editing Issues

How to Automatically Add Today's Date to a Read-Only PDF Field

Steven ParkerSteven Parker Nov 5, 2026 870 views

Question details

The user needs to automatically populate a specific PDF form field with the current date whenever the document opens and ensure the field cannot be manually edited.

How to Automatically Add Today's Date to a Read-Only Acrobat PDF Field
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating a reusable PDF form where end-users open the document, have the current date filled in instantly, and can print or save the final copy.
Observed behavior
A script is required to fetch the current date on document load, apply it to the designated text field, and lock the field properties to read-only.
Before you start

Ensure you have created a text field in your PDF form named exactly 'Today' (or adjust the script to match your custom field name) and use a PDF editor that supports document-level JavaScript execution.

Solution 1Recommended

Use Document-Level JavaScript in Adobe Acrobat

Add a custom JavaScript code snippet to the document level so it executes every time the PDF is opened.

This method utilizes Adobe Acrobat's JavaScript engine to pull your system date and format it automatically.

Keep in mind that this script will function properly only in dedicated PDF viewers that fully support Acrobat JavaScript. It may not execute if the file is opened in basic web browsers.

1
Open Document JavaScripts

Open your PDF form in Adobe Acrobat, navigate to the Tools menu, select JavaScript, and then click on Document JavaScripts.

2
Add the Custom Script

Create a new script, remove any default code, and paste the following snippet: this.getField("Today").value = util.printd("dd/mm/yyyy", new Date());

3
Set Field to Read-Only

Right-click the 'Today' form field, go to Properties, navigate to the General tab, and check the 'Read-Only' box so users cannot manually edit the auto-generated date.

4
Save the Master File

Save your master document. Ensure you distribute the unchanged online master file so each user triggers the script and receives a new date upon opening.

Use Document-Level JavaScript in Adobe Acrobat
Viewer Compatibility: If the date is not populating, ask users to download the file and open it in a compatible desktop PDF reader instead of a browser previewer.

Easily Manage and Fill PDF Forms with WPS Office

While complex scripting is restricted to certain PDF editors, WPS Office offers a powerful, built-in PDF tool that makes managing, viewing, and filling out PDF forms straightforward and efficient.

  1. 1. Open Your PDF: Launch WPS Office and open your PDF document using the built-in PDF viewer.
  2. 2. Access Editing Tools: Navigate to the Form or Edit tab on the top ribbon to interact with fillable fields.
  3. 3. Insert Date Manually: If auto-scripts are unsupported by your recipient's device, easily use the Add Text tool to place the current date exactly where needed.
  4. 4. Save and Export: Save your completed document, flatten the file to lock edits, or share it directly from the WPS interface.
Fully compatible with standard Adobe Acrobat PDF formats and formsIntuitive interface for inserting dates, text, and signatures manually or automaticallyAll-in-one suite covering Word, Excel, PowerPoint, and PDF editingLightweight architecture available across Windows, Mac, iOS, and Android
microsoft office alternative - wps office

Frequently Asked Questions

Why is the automatic date not appearing when I open the PDF in a browser?

Many web browsers and built-in OS previewers do not support Acrobat JavaScript. The user must download and open the file in a fully compatible PDF application for the script to execute.

How can I change the date format to month-day-year?

In your document-level JavaScript, locate the 'dd/mm/yyyy' string and modify it to 'mm/dd/yyyy'. The utility function will immediately format the new date to match your regional preference.

Will the date change if I save the filled document and open it tomorrow?

Yes, if the script remains active in a standard PDF, it will update to the current date each time the file is opened. To lock in the date permanently after form completion, you must flatten the PDF or 'Print to PDF' to create an uneditable version.