PDF as Form, Sent via server not email client

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BillImhoff
Forum Newbie
Posts: 5
Joined: Wed Apr 25, 2012 11:03 am

PDF as Form, Sent via server not email client

Post by BillImhoff »

Does anyone know how I can have an online pdf as a form and then send it from my server to an email address as an attachment? I dont want the person filling this out to have to use their email client. My server is running LAMP, not a windows server.
Thanks in advance! :D
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: PDF as Form, Sent via server not email client

Post by x_mutatis_mutandis_x »

You can have them download the PDF, enter info in the PDF, and then have them upload the file, after which you send that file to person's email as an attachment (http://webcheatsheet.com/PHP/send_email ... chment.php);

Or if you don't want them to download the file, have a HTML form that lets them fill out the info, and you can generate the PDF on the server (using FPDF), after which you can send the email
BillImhoff
Forum Newbie
Posts: 5
Joined: Wed Apr 25, 2012 11:03 am

Re: PDF as Form, Sent via server not email client

Post by BillImhoff »

Any other answers?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PDF as Form, Sent via server not email client

Post by Celauran »

x_mutatis_mutandis_x wrote:Or if you don't want them to download the file, have a HTML form that lets them fill out the info, and you can generate the PDF on the server (using FPDF), after which you can send the email
I think this is probably the best way to go.
BillImhoff
Forum Newbie
Posts: 5
Joined: Wed Apr 25, 2012 11:03 am

Re: PDF as Form, Sent via server not email client

Post by BillImhoff »

It does not acomplish what I need to do. I dont need a work around. Their is alredy a simple wat to do this using clients email ( as a handler) adobe life cycle. What I need ifs to interface using CGI. Thanks
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: PDF as Form, Sent via server not email client

Post by x_mutatis_mutandis_x »

BillImhoff wrote:It does not acomplish what I need to do. I dont need a work around. Their is alredy a simple wat to do this using clients email ( as a handler) adobe life cycle. What I need ifs to interface using CGI. Thanks
IMHO it's easier using PHP. There's a library called HTML2PDF which is a convinient wrapper over FPDF http://html2fpdf.sourceforge.net/. It should be relatively simple to build the HTML form, use this library to convert it to PDF once the form is filled and submitted. Why would it matter if the user enters info into a PDF or HTML form when they would look the same?
BillImhoff
Forum Newbie
Posts: 5
Joined: Wed Apr 25, 2012 11:03 am

Re: PDF as Form, Sent via server not email client

Post by BillImhoff »

If they look the same thats ok with me. I just need the email recipiant to be able to print out the information and it look the same as the form. Will this do that? Thanks again.
I dont think I understand the link you sent me to. I have the pdf already made. Im not sure what to do. Can you help?
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: PDF as Form, Sent via server not email client

Post by x_mutatis_mutandis_x »

Convert that PDF to HTML (you can search for "convert PDF to HTML" in google), and publish the HTML for the users to enter data. Capture it (and process) in PHP, and email the HTML with filled-data fields to the user. You don't have to maintain a PDF file at all.
BillImhoff
Forum Newbie
Posts: 5
Joined: Wed Apr 25, 2012 11:03 am

Re: PDF as Form, Sent via server not email client

Post by BillImhoff »

The 2 areas "Capture it (and process) in PHP, and email the HTML with filled-data fields to the user. " that the trick. The other thing is what will it look like when they print it out? I need it to look the same as the form.
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: PDF as Form, Sent via server not email client

Post by x_mutatis_mutandis_x »

BillImhoff wrote:The 2 areas "Capture it (and process) in PHP, and email the HTML with filled-data fields to the user. " that the trick. The other thing is what will it look like when they print it out? I need it to look the same as the form.
By capturing it in PHP I mean simple form submission, and accessing the $_POST values. If you want it to look exactly the same as your PDF, test it out. Print the HTML out and see how it looks (if it looks different than your PDF, tweak your HTML; make sure to test against most commonly used browsers like Firefox, Chrome, IE, Safari).

Send a test email to yourself and see how it shows up. Unless you check it out and test it, neither you nor I can tell you if it'll match your PDF or not
harrybro
Forum Newbie
Posts: 1
Joined: Fri Apr 27, 2012 1:19 am

Re: PDF as Form, Sent via server not email client

Post by harrybro »

I dont think I understand the link you sent me to. I have the pdf already made. Im not sure what to do. Can you help?



Harry Bro...
Post Reply