Skip to main content
Participant
November 25, 2024
Question

"Saving Button" on PDF File, which saves it locally (with dynamic naming)

  • November 25, 2024
  • 1 reply
  • 1083 views

Dear Community,

I couldn't quite find what I was looking for using the search function, so here is my question:

I would like to implement a button on a PDF using Java Script, that saves the PDF locally in the current state via a mouse up trigger and, ideally, adds a time stamp to the name.

My first attempts were not successful, hence my question to you pros:

Is this even possible? (access rights etc.)

Thanks a bunch for any help in Advance!!

 

1 reply

PDF Automation Station
Community Expert
Community Expert
November 25, 2024

Yes it's possible but if you need it to save "silently", that is without user interaction, you will need to button to trigger a trusted function from a folder level script.  Otherwise you will have to use 'Save As' and the Save As window will pop up for the user to choose the directory and file name.  Which one do you want?

Participant
November 25, 2024

Thanks a lot for your response!

Well it should work “standalone”, if the PDF is sent to another person/device it should work there too.

I think this would only work with dialogue?

PDF Automation Station
Community Expert
Community Expert
November 25, 2024

Correct.  Make a field called "Time" where you want the time stamp, then add this Will Save action:

this.getField("Time").value=util.printd("mm/dd/yyyy HH:MM", new Date());

Then add this script to the button:

app.execMenuItem("SaveAs");