Skip to main content
Participant
Nov 25, 2024 9:41 AM UTC
Question

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

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!!

 

9 replies

PDF Automation Station
Community Expert
Community Expert
Nov 25, 2024 10:56 AM UTC

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?

Translate
Participant
Nov 25, 2024 11:57 AM UTC

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?

Translate
PDF Automation Station
Community Expert
Community Expert
Nov 25, 2024 12:22 PM UTC

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");

Translate