I use Adobe Acrobat 9 professional, and do not have access to LiveCycle Designer, so please do not recommend any solution involving LiveCycle Designer.
I have a very specific, and probably very easy to resolve, problem.
I have an Acrobat Form designed in 9 Professional which has numerous fields, some of which are calculated and read only, but most of which are the result of some input, a keyboard entry, or a mouse click, etc.
There are two specific fields, “Surname”, which has to be entered from the keyboard, and “TodayDate” which is filled automatically when the field is opened by a document level script –
// Populate the TodayDate field with today's date
var d = new Date();
this.getField("TodayDate").value = util.printd("dd-mmm-yyyy",d)
My problem is:
I want to design a (non-printable) button that will save the data in all the fields (except those that have been calculated and are read only) with the file name “yymmddSurname.fdf” where yy is the 2 digit year, mm is the two digit month, and dd is the 2 digit day of the contents of the TodayDate field, and Surname is, of course, the contents of the Surname field. Thus the save file will be something like 040808Smith.fdf. I also want the person who presses the button to have the choice about where to save it, and, if he/she wants to, to change the name of the file saved. However, at the same time (that could be before the file is saved by the person filling in the form) the file, with its specified filename “yymmddSurname.fdf”, needs to be sent by email to two given email addresses.
Any suggestions would be gratefully received.
David
> I have a very specific, and probably very easy to resolve, problem.Most of what you want can be done using the doc.exportAsFDF() JavaScript method, but certain security restrictions apply as detailed in the Acrobat JavaScript reference. You can specify which fields you want included in the FDF.
> I also want the person who presses the button to have the
> choice about where to save it, and, if he/she wants to, to
> change the name of the file saved.This should not be a problem. You could first prompt the user (e.g., with app.alert) with the proposed file name and location and ask if it's OK. If Yes, include the path in your exportAsFDF call; otherwise don't include the path/filename in the exportAsFDF call and the user will be prompted for the location and filename.
> However, at the same time (that could be before the file is
> saved by the person filling in the form) the file, with its specified
> filename “yymmddSurname.fdf”, needs to be sent by email to
> two given email addresses.That might be a problem. The doc.mailForm() method will do most of what you want, but it does not allow you to specify a file name for the FDF attachment.
George