These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

this.mailDoc file name

bazzacad
Registered: Dec 8 2011
Posts: 3
Answered

Hi guys, I've seen this question asked a few times, but I haven't found an answer to it. When I use this.mailDoc() to attach the current document to an e-mail, the attached file always appends "- Adobe Acrobat Pro.pdf" to the end of the file name. I think it's pulling this information from the title bar of Acrobat instead of the real file name. Has anyone fond a solution to show keep the actual file name for the attachment? I'm on Acrobat Pro 10.1.1.
 
Thanks,
Barry

My Product Information:
Acrobat Pro 10.1, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Accepted Answer
This suffix is attached when the form was changed but not saved.
You have two options.

1. Save the form before you send it
2. Execute this script before you sent it
this.dirty = false;

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

bazzacad
Registered: Dec 8 2011
Posts: 3
Thanks for your suggestion, it kind of worked. It does remove the suffix in the attached file, but the file now doesn't include any of the changes I made before sending it...
I open an existing PDF, add a comment, & then run this code:this.flattenPages(this.pageNum);
this.dirty = false;
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

(Yes the variables are defined for mailDoc, just not shown here)

The files gets attached without the suffix, but my comment is lost.

I also tried:

this.flattenPages(this.pageNum);
app.execMenuItem("Save");
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

And still no comment...
bazzacad
Registered: Dec 8 2011
Posts: 3
OK I used this code to save the file first:
http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

And now it works.
Still wish I could use: this.dirty = false;