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

Attached Files and Subject Lines

Runolfr
Registered: Oct 1 2008
Posts: 119
Answered

I have a form that uses a Submit button to send the content as an attached PDF. I have also added a preSubmit script to verify that the form is complete and protect the containers on submission (see http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=14274 for that script... that's where I got it).

At this point, the attached form has the filename of my original source form. What I would like to do is define the name of the attached PDF form when it's submitted, using data from the form itself as part of the filename. I would also like to use data from the form in the subject line of the email that's generated. Is there a way to accomplish these goals?

Runolfr
Registered: Oct 1 2008
Posts: 119
It occurs to me that I will probably also want to capture the submitter's email address, if it's possible to do that during the submit process.
Runolfr
Registered: Oct 1 2008
Posts: 119
I've solved the subject line question, but still don't know if it's even possible to specify the filename for the PDF attachment. Anyone?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is an issue that's come up quite a bit. It would be really, really nice to be able to rename the attachment, but this is not an easy option. Acrobat sets the name of the attachment to the name of the file that's submitted.

So the solution is to save the file to a different name. Unfortunately, this is a privileged operation, so it can't be done with code from inside the document. About the best you could do is to ask the user to save the file to a new name:(

The submitters email may or may not be stored in the Identity object. However, the Identity object is privileged for obvious reasons and again, cannot be accessed from a script in a document. You're best bet here is to ask for the user's email on the form.


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script