Skip to main content
Participant
August 23, 2023
Question

Add document level script in PDF

  • August 23, 2023
  • 1 reply
  • 181 views

Hello,

We want to automate the proess to add script in PDF file using some PDF SDK or API. 

We want to add a field in PDF file  and execute Script to display today's date whenever  user open's file to print it.

var theDate = new Date();
theDate = theDate.setDate(theDate.getDate() + 28);

this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());
this.getField("InOneMonth").value = util.printd("mm/dd/yyyy", theDate);

 

Below article specifies the steps but we want to achive it through code / api integration.

 

https://answers.acrobatusers.com/Insert-current-date-text-field-todays-date-todays-date-4-weeks-q300987.aspx 

 

Thanks in advance.

 

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    August 23, 2023

    We don't currently have an API to do this. However, you can automate it in Acrobat.