Link to home
Start Free TrialLog in
Avatar of mike_silver
mike_silver

asked on

E-mail button on Livecycle created PDF not working

Attached is a form created using Adobe Livecycle. The "Submit by E-mail" button is from the standard Livecycle object library. Unfortunately using this button does not work in Adobe Reader (we use Reader 9+) because only the data is e-mailed, not the whole PDF form. Most of my users have Reader, no Acrobat. I have found code on the web to create my own e-mail button, which is marked with just a "1" on the button on top of the form. The code compiles without errors but the mydoc.maildoc does not execute. If I put a messagebox on both sides of the mydoc.maildoc statement the messagebox below the mydoc.maildoc  does not execute, telling me that there is something wrong with the mydoc.maildoc statement. As you can see in the code I've tried several iterations of the code.

In addition, I'd like to pull a couple of the fields, FranchiseeLastName + FranchiseeFirstName + a date/time stamp and save the file to a network directory for backup right before or after the mydoc.maildoc executes. So I'm also trying to figure out how to use the saveas command.
Notice-Of-Loss.pdf
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

When you open the JavaScript console before you click the button, you will see the following error message:

mydoc.maildoc is not a function
3:XFA:form1[0]:Page1[0]:HeaderSubform[0]:Button1[0]:click
mydoc.maildoc is not a function
3:XFA:form1[0]:Page1[0]:HeaderSubform[0]:Button1[0]:click

It looks like you did not define that function. Saving the file will require that the form is reader enabled - otherwise somebody with just Reader will not be able to save the file. If you want to use Acrobat to reader enable your document, there are licensing restrictions (up to 500 copies distributed, or 500 returned copies processed).
Avatar of mike_silver
mike_silver

ASKER

Thanks for seeing that. But I need the coding for e-mailing and for save-as.
Your question is a bit ambiguous about what you want: Do you want to return the whole PDF file or just the form data? If it's the whole PDF file, that's not possible with Reader - maybe that's the problem you are running into. There is no custom script that will do that for you. The only way to accomplish that is by reader enabling the document, which you can do with Adobe Acrobat, but you have to stay withing the 500 copies/processed documents limit.
The form is located on my network. The user's of the form are all in-house. This is what I want to happen:
1) When the user opens the form I want it to automatically save-as to c:\temp\notice of loss.pdf so that they are not modifying the original form. I am already doing this with a .bat file and then opens the copy of the form, so this part is not crucial but it would be better programming.
2) User fills in the form.
3) When the user presses the "Save & E-mail" button it would save the form to j:\somedirectory\notices of loss\lastname_firstname_DOLyyyymmdd_Reportyyyymmdd.pdf and then e-mail the form to claims@snaponsecurecorp.com, where the following fields are pulled from the form:
   a) lastname = FranchiseeLastName
   b) firstname = FranchiseeFirstName
   c) DOLyyyymmdd = LossDate
   d) Reportyyyymmdd = ReportDate

The e-mail needs to send the whole PDF, not just the data. I know it can do that because Reader has the "Attach to E-mail..." command which creates an e-mail and attaches the currently open form. The form is Reader enabled through Acrobat.
Can anyone help?
ASKER CERTIFIED SOLUTION
Avatar of mike_silver
mike_silver

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial