Solved

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

Posted on 2013-01-17
13
990 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now