Solved

HTML/PDF/PHP to populate PDF File and send as attachment

Posted on 2013-01-17
13
1,001 Views
Last Modified: 2013-06-30
Hi,

i  want to create a PDF to email when people fill it in and save as a ".pdf" file without the use of the clients outlook or mail.

do you think this would be best used in PHP or is their a way to do this within LifeCycle Designer?

I have tried to use FPDF and i wasnt able to get it working.

Imran
0
Comment
Question by:Imran Shabir
  • 6
  • 6
13 Comments
 
LVL 9

Expert Comment

by:rinfo
ID: 38792385
Maybe you should try another pdf engine.
There are lots of such engine which allows you to create a pdf file from form itself.
TCPDF is one such engine and there is a nice and elaborate example that does just this.
http://www.tcpdf.org/examples/example_054.phps
Have a look
0
 
LVL 9

Expert Comment

by:rinfo
ID: 38792389
by the way what's  problem you are having with fpdf .
its one of the best suited for your purpose.
0
 

Author Comment

by:Imran Shabir
ID: 38792400
I am trying to render and try to use its examples etc. but it doesnt work..

example of one..

http://imranshabir.co.uk/test/test.php
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 9

Expert Comment

by:rinfo
ID: 38792405
can you post your code here.
Error say you are having problem with phpmailer and guess it has nothing to do with fpdf.
Are you sure you have included phpmailer script in your test.php
0
 

Author Comment

by:Imran Shabir
ID: 38792566
hi i tried the tcpdf and downloaded the files from the website and uploaded it to my site but i keep getting an error of it trying to open a file.. i have checked the permissions and granted full access to the folder.. i uploaded all the files (except example folder)

link: http://imranshabir.co.uk/tcpdf/eetest.php

error:
Fatal error: main() [function.require]: Failed opening required '/config/lang/eng.php' (include_path='.:/usr/lib/php') in /homepages/1/d336192082/htdocs/ImranShabir/tcpdf/eetest.php on line 30
0
 
LVL 9

Expert Comment

by:rinfo
ID: 38792618
What do you wants to achieve .
My impression was you wanted to send  an email which has as attachment a pdf file that has  the values entered by a user in the web page form.
Or is it that you wanted to mail to user a pdf file that contains a form .
Once i know that i would try and create a php script for you using fpdf or tcpdf.
0
 

Author Comment

by:Imran Shabir
ID: 38792653
Its the 1st one.. A user enters info into a few fields and it emails with the info into a pdf (specific fields)
0
 
LVL 9

Assisted Solution

by:rinfo
rinfo earned 334 total points
ID: 38792819
i think this example suits your requirement fine.
Try and understand how it is done and it should work for you.
http://coreyworrell.com/blog/article/php-html-email-pdf-attachment
0
 

Author Comment

by:Imran Shabir
ID: 38792847
Hi, i wont be able to try it till later and respond later today. I run the demo and saw the attachment its exactly as i want it. I will try understanding it later and respond.

Thanks again
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 166 total points
ID: 38792880
LifeCycle Designer would not help you. There is no need to go to Designer, you can just create "normal" AcroForm fields and then have your customers/clients/users submit the form not via email, but via a submit request to your web server. In this case, you would receive the data just like from an HTML form, and your PHP script can then do whatever it needs to process the data.

There is also an option to submit the data in the "FDF" format, which would allow you to e.g. merge that FDF file with the original PDF file and create a filled form. You can do that for example with the free pdftk program (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/). If you also use the flattening option in pdftk, you end up with a non-interactive PDF form, so that nobody can modify the form fields anymore.
0
 

Author Comment

by:Imran Shabir
ID: 38793863
hi, looking into the http://coreyworrell.com/blog/article/php-html-email-pdf-attachment  examples.. i wasnt sure how id implement the data to populate the fields in the attached pdf.
test.pdf
0
 
LVL 9

Accepted Solution

by:
rinfo earned 334 total points
ID: 38793946
What you actually doing should be is create a routine/function that will have form values as parameters and using fpdf,tcpdf or any pdf engine create a new pdf everytime submit button is clicked.
Unless your code / or some sort of detail about working is provided , i wonder if somebody would be able to help much
0
 

Author Comment

by:Imran Shabir
ID: 38794670
Rinfo u suggested that you will create a script to my requirements above.. Is that not possible?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question