×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Saving to Server and Email using a SMTP server

Saving to Server and Email using a SMTP server

Saving to Server and Email using a SMTP server

(OP)
We have a PDF form we are currently using. Once it is filled out, it is printed but not saved online. We would like to go green so I would like to add two pieces of functionality to it in one button. Unfortunately I do not have any experience doing this with Javascript. I would create the funcionality in Adobe Acrobat X Pro but the people filling out the form would do so using Adobe Reader.

The first piece of functionality would be to save the PDF with the form data to a location on our server. The name of the document would come from a couple of fields in the PDF (ex: John Smith DOR 7-8-14.pdf). The name and date would come from fields in the form but the "DOR" part would be the same every time. The form is being completed and saved to our in-house server. The saved form would still need to be editable by the indivdual reviewing it (see the second piece of functionality).

The second piece of functionality would be to send an email notification to an individual (same person every time) letting them know the PDF form has been completed. I only need to send the notification, not the PDF itself. In addition, I would like to include the name on the form as part of the text notifying the individual (ex: John Smith has a DOR to be reviewed). The name would come from a field in the form but "has a DOR to be reviewed" would be the same every time. The problem is that we use an internet based email client (Lotus Notes). I have the port # and designation of the SMTP server.

I hope I have explained it well enough and included sufficient detail in order to get the help I need.

Thank you in advance for any help anyone can offer. bigsmile

RE: Saving to Server and Email using a SMTP server

Is this a form to be used internally, only at your employer? There could be major security issues involved if you distribute a PDF form that includes SMTP authentication information. Others could take that information and use your mail server for spam.

Saving individual PDF files for each record is not much more efficient than printing out each form. You're saving a few leaves on a tree but you still have a disorganized mess. You may find joy in stepping it up to having all this form data collected in a database. There should be description of this in the LiveCycle Designer documentation and in articles like this:
http://partners.adobe.com/public/developer/en/live...



RE: Saving to Server and Email using a SMTP server

Quote (mcelligott)

...save the PDF with the form data to a location on our server...
If you make that location a fixed folder, another way to accomplish this might be a folder watcher that sends that notification once the pdf has been saved in that folder.
.Net framework, for example, has a FileSystemWatcher Class.
You could write a little .exe in VB.Net or C# that would observe that folder and on file creation in that folder sends out the notification.
That way the SMTP authentication details would not be required in any distributable file.

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Saving to Server and Email using a SMTP server

(OP)
Hi spamjim,

Yes, the form is only being used within our department. I would love for them to go to a database set up but management is resistant at this point. At least by saving the PDFs to the server it will save at least one whole tree. It is amazing just how much paper we use just with this one form currently.

Thanks for the response.

Hi MakeItSo,

The location the PDF will be sent to is a fixed folder location. I have never heard of such a thing as a folder watcher and wouldn't even know how to write that kind of code. I have a little bit of VB knowledge but nothing at that level of knowledge. I would be interested to see a sample of that and how to install it, especially the part about sending the notification to the SMTP server in order to send the email.

Thank you for your response.

Now if I can just figure out how to automate the process of saving the PDF to the static folder location with the information as stated in the original post.

RE: Saving to Server and Email using a SMTP server

OK,

Part 1.) Custom save button:
You will need a Javascript action behind it. The Javascript will probably look somewhat like this (hope the JS scracks can help out here):

CODE

var savename=this.getField("firstname") + ' ' + this.getField("lastname") + 'DOR ' + this.getField("date");
this.saveAs(savename); 

Part 2.) Watch4Folder seems to be a nice way to do it. It is freeware and can fire an executable on events:
http://www.portablefreeware.com/?id=1820

Then you'd only need a batch file or whatever to send out the notification.

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Saving to Server and Email using a SMTP server

(OP)
Hi again MakeItSo,

I created a button with the javascript you recommended but it did not work. I tried to save the PDF to the local computer first just to see if it would do it before I tried to tackle saving it to a network folder. I have been doing some research and found some reference to a "folder-level trusted function". Do I need to do this as well, whatever it is? Here is the code I used (I used the fields from the PDF I use):

CODE

var savename='/c/temp/' + this.getField("Trainee") + ' DOR ' + this.getField("Month") + '-' + this.getField("Day") + '-' + this.getField("Year");
this.saveAs(savename); 

I really appreciate your help so far. Any thoughts?

Bob

RE: Saving to Server and Email using a SMTP server

Quote:

I would love for them to go to a database set up but management is resistant at this point.

Management is not opposed to change. They are opposed to cost. Doing this without a database is more costly, taking more time to implement, and requiring more time to process/analyze aggregate data.

RE: Saving to Server and Email using a SMTP server

It would appear that this.saveAs is disabled by security in Acrobat Reader. :-/

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close