Skip to main content
Participant
September 25, 2023
Answered

How to change/update a text with Acrobat Javascript?

  • September 25, 2023
  • 1 reply
  • 2071 views

Hello,

In my PDF file, I would like to automatically update a text (not a form's field) with the current date DD-MM-YYYY after the PDF document is loaded (on Windows and Android).

Is Acrobat Javascript able to do this?
If yes, which JS commands can do it?
If not, how can I do it?
Regards,
Sam
This topic has been closed for replies.
Correct answer try67

Acrobat JS can't edit static document text. You can add new text by adding a form field and then flattening it (for example), and you can remove text by redacting it, but this seems like overkill (and will also not work outside of Acrobat). Why not simply use a (read-only) text field for this?

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 25, 2023

Acrobat JS can't edit static document text. You can add new text by adding a form field and then flattening it (for example), and you can remove text by redacting it, but this seems like overkill (and will also not work outside of Acrobat). Why not simply use a (read-only) text field for this?

Participant
September 26, 2023

I used your last idea: a simple read-only text field, without border.

Problem solved. Thank you try67 and happy coding 🙂