Ejemplo n.º 1
0
<?php

$total = $_POST['total'];
$name = $_POST['NameChild'];
$date = $_POST['DateChild'];
$t = time();
$day = date("Y-m-d", $t);
$pdfname = $name . $day . ".txt";
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 20);
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 20);
$pdf->WriteHTML('<para><h1>PATIENT HEALTH QUESTIONAIRE: PHQ-A <em><br><br>(adolescent 2-17 years old)</em></h1><br></para>');
$pdf->SetFont('Arial', '', 18);
$htmlTable1 = '
<TABLE>
<TR>
<br>
<br>
<TD>Name:' . $_POST['NameChild'] . '<br><br></TD>
<TD>Date:' . $_POST['DateChild'] . '<br><br><br><br></TD>
</TR>
</TABLE>
<br>
<pre>
<br>
1.Feeling down or depressed or hopeless-' . $_POST['Q1'] . '<br><br>
2.Little interest or pleasure in doing things-' . $_POST['Q2'] . '<br><br>
3. Trouble falling or staying asleep, or sleeping too much-' . $_POST['Q3'] . '<br><br>
4. Feeling tired or having little energy-' . $_POST['Q4'] . '<br><br>
Ejemplo n.º 2
0
<?php

require 'WriteHTML.php';
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
$pdf->Image('logo.png', 18, 13, 33);
$pdf->SetFont('Arial', 'B', 14);
$pdf->WriteHTML('<para><h1>PHPGang Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</h1><br>
Website: <u>www.phpgang.com</u></para><br><br>How to Convert HTML to PDF with fpdf example');
$pdf->SetFont('Arial', 'B', 7);
$htmlTable = '<TABLE>
<TR>
<TD>Name:</TD>
<TD>' . $_POST['name'] . '</TD>
</TR>
<TR>
<TD>Email:</TD>
<TD>' . $_POST['email'] . '</TD>
</TR>
<TR>
<TD>URl:</TD>
<TD>' . $_POST['url'] . '</TD>
</TR>
<TR>
<TD>Comment:</TD>
<TD>' . $_POST['comment'] . '</TD>
</TR>
</TABLE>';
$pdf->WriteHTML2("<br><br><br>{$htmlTable}");