Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Set file name when using an email button.

Explorer ,
Jan 14, 2016 Jan 14, 2016

I have a invoice with an email button that will use to email a copy to my customers.

But when the attachment is sent the file name is random numbers and letters, not the same file name as the original pdf.

Is there a command that I can put in my script that will take data from the from (Invoice and Date) and use it for the file name when it sends the email?

This is the script I am using.

// Collect the Customer's Email Address

var cToAddr = this.getField("Email").value;

// Set the subject and body text for the email message

var cSubLine = "Paperwork"

var cBody = "Here is your paperwork."

// Send the first page as a file attachment in an email

var page0 = this.extractPages(0); 

page0.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});  page0.closeDoc(true);

TOPICS
Acrobat SDK and JavaScript
534
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2016 Jan 14, 2016

Since I wrote this code for you I'll chime in (PS. In the future it's better to ask follow-up questions in the original thread, instead of opening a new one).

The answer is that without installing a script on the local machine of the user it's not possible to change the file name, not automatically at least.

You can always prompt the user to save the file before submitting it, though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2016 Jan 14, 2016

Thank you,

In case anyone also has a problem with the random numbers and letters in the file name...it was because I had a space in the original file name.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2016 Jan 14, 2016
LATEST

What happens when you remove the space?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines