Forum Moderators: coopster

Message Too Old, No Replies

checkboxes and fpdf

         

MsCrow

10:17 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



Hello

I am building a form for students to assess their skills so it goes as such

<tr>
<td width="60%"><p><strong>Skill</strong></p></td>
<td> <p><strong>I have already developed this skill</strong></p> </td>
<td><p><strong>I need to improve this skills</strong></p> </td>
</tr>
<tr>
<td width="60%"> <p>Ability to communicate effectively with people in a work environment</p> </td>
<td width="20%"><input name="attribute" type="checkbox" class="form" value="Ability to communicate effectively with people in a work environment" /></td>
<td width="20%"><input name="attribute" type="checkbox" class="form" value="Ability to communicate effectively with people in a work environment" /></td>
</tr>

I am using fpdf to save documents so students have a record they can print. The above form outputs to my fpdf driven file. I want this file to have a heading such as 'Skills I have' and underneath to display all the checked box titles of the skills they have. I'm not sure what php code to use in my fpdf file, I'm also not sure I've titled my checkboxes well for this.

The fpdf file would be something like...though it doesn't work

$pdf->Multicell(0,5,'These are the employability skills that you already possess'.$i,0,1);
$pdf->Ln(5);
$pdf->Multicell(0,5, foreach ($attribute as $f) {echo $f."<br />");
$pdf->Ln(5);

I would greatly appreciate any feedback on how to do this.

Ellie

coopster

5:18 pm on Sep 1, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The PDF is not going to render HTML so you need to remove any form of HTML logic and coding from your PDF coding. Create your loop, apply the PDF formatting ... pseudocode:
foreach ($attribute as $f) { 
$pdf->Multicell(0,5,$f);
$pdf->Ln(5);
}

whoisgregg

8:54 pm on Sep 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The FPDF Tutorial page on building tables should be very helpful. [fpdf.org...]

inquireorenquire

6:53 am on Sep 4, 2006 (gmt 0)

10+ Year Member



You might find it better to create LaTeX and then run it through pdflatex. LaTeX is rather like HTML in many ways and translating from HTML to LaTeX isn't that hard. pdflatex is free and will kick out pretty PDF files without too much fuss.