Skip to main content
Participant
June 19, 2024
Question

Save as button with file name

  • June 19, 2024
  • 3 replies
  • 870 views

I have a PDF form and want to add a button to prompt "save as" and auto populate the file name based on 2 fields from my form. The user will then select the folder that the file will be saved. 
any help would be appreciated. 

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
June 19, 2024
PDF Automation Station
Community Expert
Community Expert
June 19, 2024

You would have to use the app.browseForDoc method to simulate a "Save As" browse window (the file window says "Save As", allows a default file name that the user can change, and lets the user select the file location), then pull the path from the result and use doc.saveAs.  Unfortunately, browseForDoc and saveAs (silently) are privileged, so all users would need a trusted function in a document level script.

Thom Parker
Community Expert
Community Expert
June 19, 2024

Unfortunately this type of functionality is not easily implemented with a PDF. 

Please read this article on how to save a PDF with a script:

https://www.pdfscripting.com/public/How-to-Save-a-PDF-2.cfm 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often