Solved

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

Posted on 2013-01-17
13
1,008 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

729 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