Skip to main content
Known Participant
January 27, 2024
Question

JavaScript SaveAs with renaming filename

  • January 27, 2024
  • 1 reply
  • 10279 views

Dear Community,

I'm new with JS and Acrobat. I'm looking for a small Code for following Task:

I have an open pdf file and now I need a button to do the following:

Only save the open file in the same directory, but with filename = oldfilename_username.pdf  so I can

work with this new file. The old file should be closed. I think I  need identity.loginname  for username.

Is the best was use an Action with JavaScript Code?

 

Do you have some Code for me?

 

Best Regards

Josh

This topic has been closed for replies.

1 reply

Known Participant
January 27, 2024

This code does not work:

 

 

Bernd Alheit
Community Expert
Community Expert
January 28, 2024

Where do you use the function?

Known Participant
January 28, 2024

Hi Bernd,

 

I have an Action with JavaScript you see in my screen. Perhaps I need something like 

app.TrustedFunction() to run successfully the code?

Perhaps you can help me.

BR

Josh