QuickFrom and pdf generating
| From: | Köteles Zoltán | Date: | Mon, 12 Jun 2006 09:50:56 +0000 |
| Subject: | QuickFrom and pdf generating | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-24322@lists.php.net to get a copy of this message | ||
Hello,
I'd like to create a pdf document generated by QuickForm.
I'd like to capture all of the stylesheets datas and everything.
What I did (but it's not working):
if ($form->validate()) {
require_once $include_dir.'/html2fpdf.php';
ob_start();
$form->freeze();
$html = ob_get_contents();
ob_end_clean();
$pdf =& new HTML2FPDF();
$pdf->AddPage();
$pdf->WriteHTML($form->freeze());
$pdf->Output('doc.pdf', 'I');
}
or
if ($form->validate()) {
require_once 'File/PDF.php';
$pdf = &File_PDF::factory(array('orientation' => 'L', 'unit'
=> 'pt', 'format' => 'A4'));
$pdf->open();
$pdf->AddPage();
$pdf->text(0, 0, $html);
$pdf->close();
$res = $pdf->Output('doc.pdf', false);
if (PEAR::isError($res)) {
return $res;
}
}
How can I do that?
Thanks a lot
ZoTyA