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

Email Button - pdf instead of xml data?

cfinley
Registered: Jan 9 2008
Posts: 70
Answered

I have a sample request form I'm making with user emails set to the submit email button, but I was disappointed to find it sent only xml data, not the actual filled out pdf..

So is there a way to set up the pdf so it will email a completed copy of itself, not just the raw xml? Is there a way to specify that the combo box data selected should become static, but still have other functioning buttons? (like a 2nd submit email button that would forward along to a 2nd department)

Thanks

DominicanPete
Registered: Jan 4 2008
Posts: 41
This is a little tricky, but very doable. Open your document in LiveCycle Designer. You need to see 3 tabs over the document:

Design View
XML Source
Preview PDF

If you do not see the xml source tab, right click on the 'Design View' tab and select 'XML Source'. The tab should appear.

Select the 'Design View' tab, and within the document, select the 'Submit Email' button. Now select the 'XML Source' tab. You should see the line for your email button control hilited. It should read something like this:

Start looking down the code from here until you find a line that reads:

cfinley
Registered: Jan 9 2008
Posts: 70
you rock man! any hints on how to set up the subject line to be a static text + input from selected field?

for example, say in the sample request they ask for part number ABCD - how could I make is so the email subject line would be "sample request - ABCD"?

and can I set it so the pdf that gets emailed will change the name of the file as well, add in my part number value and/or the date?

(ex instead of "sample request.pdf", have the file be "sample request ABCD Jun10.pdf"
DominicanPete
Registered: Jan 4 2008
Posts: 41
What you want to do is not possible with the Email Submit button. It IS possible with a regular push button, and some javascript attacted to the 'click' event of the button. You will need something like this:


var myDoc = event.target;
myDoc.mailDoc({
bUI: false,
cTo: EMail_List.rawValue,
cSubject: "My Text " + Subject.rawValue,
cMsg: "This is my text" + field1.rawValue
});
}

This javascript snippet has the following attributes:

EMail_List was a hidden text field that i created to contain the string for recipient(s). I used check boxes rather than a drop down list. Whenever a check box was changed, i updated the field with the new list. If you want to send to more than one email address, concatenate your addresses together in a single field and separate each address with a semi-colon.

Subject.rawValue was another text field on the form. You can assign it whatever value you choose. This is also true of msg variable.

Make sure that your language is JavaScript for the code. Run At: must be set to 'Client'.

This is a more flexible way of sending off the email as you have a bit more control over what goes on.

BTW - this is NOT an original idea on my part!! I found this snippet in this forum that was posted by previous users. Just sharin' the love!
cfinley
Registered: Jan 9 2008
Posts: 70
any advice on changing the name of the actual pdf file that gets sent depending on field input?

something like: filename = "my text" + field1.rawvalue + field2.rawvalue.pdf?

Thanks again for all your help!
DominicanPete
Registered: Jan 4 2008
Posts: 41
Sorry - WAY over my head on this one!! There is some internal processing that goes on here that i havn't been able to figure out. When you click the submit button using the 'mailto', the file is somehow saved and attached to the mail message. There is a little piece of magic that goes on here to do the save of the doc and attaching it. This is the piece that i cannot figure out, and i am not sure that we actually have any contro here. I would LOVE to be proved wrong on this one - it is only from experience that I am saying this.

Good luck with your search!
DanielKunz
Registered: Jan 22 2008
Posts: 55
DominicanPete wrote:
Change the format from "xml" to "pdf", save the document and test it. It should now send the form as a PDF rather than xml. Post back if this does not work. Good luck!
I've tested your tip in my form, but when I click the button an error "Operation not permitted" occurs.
What can I do?
DominicanPete
Registered: Jan 4 2008
Posts: 41
Woof. Not sure on that one. Did it work when the document type was xml? If you get the same error, it may be a mail security thing. After that, i honestly don't know. The fact that the error says "Operation" is not permitted, I am inclined to think it is something with your mail client. Sorry I can't give you any more info. Maybe someone else out there might have an idea...
DanielKunz
Registered: Jan 22 2008
Posts: 55
When the document type was xml there was no problem.
The specific error was "This operation is not permitted."
I have tested it on an other pc with an other mail client and the same error occurs.
DominicanPete
Registered: Jan 4 2008
Posts: 41
Last thing to try, after this, I am out of ideas.

Change the 'xml' to 'pdf' in your LiveCycle doc, and save it. Now, open it in Acrobat Professional. Select the 'Advanced' menu opion. Select the 'Enable Usage Rights in Adobe Reader', and save the file. Open your file and test again. If you are running the form in Reader, and do not go through this process, you do not have save rights to the form in Reader. This allows the form to be saved, and ultimately, sent as an email. Good luck...
DanielKunz
Registered: Jan 22 2008
Posts: 55
After that, nothings happens when i click the button.
DominicanPete
Registered: Jan 4 2008
Posts: 41
2 things - do you have an email client (e.g. outlook) installed on the machine you are sending the document from? With this method, you MUST have an email client. I get the 'blank stare' effect when i try running these forms on a machine that has no email client.

Secondly, are you using the standard 'Submit Email' button that LiveCycle provides, or the code snippet from above? I would create a test form that has 2 buttons - one with the LiveCycle email submit button, and a regular ole button that uses the code from above. Test both. If neither work, you've got other issues. If the standard email button works, and the other dosen't, than there is an issue with the way you implemented the code. Provide as much detail as possible, and we should be able to get this working.
DanielKunz
Registered: Jan 22 2008
Posts: 55
I used the standard e-Mail button, but when I use the code from above it works.
Thank you for your help!
dk3dknight
Registered: Jan 22 2008
Posts: 136
You can also use just a regular button with a submit option and select pdf and set it up with a mailto url.

mailto:name [at] name [dot] com?subject=SubjectThat will give you a pdf, with the feature to email with a predefined subject that is set by the form author.

mailto:chris [at] chris [dot] net?subject=AM-301 Stock Form Enabled(Would sent a email to chris [at] chris [dot] net with a subject of Stock Form Enabled.)Then you of course would open it up in adobe pro and go to Advanced -> Enable User Rights in Adobe Reader.Or set up a distribution, which will create a pub file and a dataset, and the pub will have rights already enabled.

Thats about all I know.
DominicanPete
Registered: Jan 4 2008
Posts: 41
DanielKunz wrote:
I used the standard e-Mail button, but when I use the code from above it works.
Glad to hear that it worked for you. It gets to be a bit confusing at times, but i have found plenty of help on these forums. Good luck on your projects!
kathleen-nodzak
Registered: Dec 19 2007
Posts: 3
This discussion (http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=2148) has been very helpful to me. Thank you. changing submission as a pdf rather than xml worked for me!!

I have one additional questions: Is it possible to change the name that is displayed in the Outlook To: field. It does show the mailbox name where we will be sending our form but the mailbox is used for collecting other forms and we do not want to confuse people. Is there a way to change the xml code in the livecycle designer to display a name different than the mailbox name. Hope this is not too confusing. If you can e-mail me at kathleen [dot] nodzak [at] mercer [dot] com I would appreciate it since I am not sure how to get back to view a response.
RazorV
Registered: Jan 21 2008
Posts: 1
DominicanPete:

Man I can't thank you enough for this. I wonder what the heck Adobe is thinking when they hard code a Submit by Email button to send in XML format. Who in the world can use an XML formatted form? Not a human. Oh well, thanks so much!