Skip to main content
Participating Frequently
Feb 6, 2025 3:45 PM UTC
Question

save attachment in a specific name

Goodmorning,
I have created a button with a script that saves the last page and send it as an attachment

 

var d = this.extractPages(this.pageNum);
d.mailDoc({cTo: "test@gmail.nl", cSubject: "Information" + (this.pageNum+1) + " from " + this.documentFileName, bUI: false});
d.closeDoc(true);

 

The only thing i can't figure out is how to save the attachment in a specific name.

Does anybody has an idea how i can add this ?

And is it possible to add textfields from within the pdf file to the file name ?

For example mut-Text15 


Thank you very much for youre help !

12 replies

JR Boulay
Community Expert
Community Expert
Feb 12, 2025 10:07 AM UTC

[MOVED TO THE ACROBAT DISCUSSIONS]

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Feb 6, 2025 4:57 PM UTC

It's possible, but tricky. Read this:

https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

 

Translate
Participating Frequently
Feb 6, 2025 8:34 PM UTC

thank you. Yes i have read this post but don't know how to fit this within my script. Can you help me ?

Translate
try67
Community Expert
Community Expert
Feb 6, 2025 8:38 PM UTC

First question is: Can you install a script file on the local computer of each user who will use this file?

If not, then you can't do it. The closest you can get is to request them to save the file under a specific name, and prevent the file from being submitted back to you if it doesn't have the correct name, but you can't force it to be saved under that name in your code.

Translate