Re: QuickFrom and pdf generating
| From: | Justin Patrin | Date: | Mon, 12 Jun 2006 18:47:39 +0000 |
| Subject: | Re: QuickFrom and pdf generating | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24326@lists.php.net to get a copy of this message | ||
On 6/12/06, Köteles Zoltán <zoltan.koteles@chello.hu> wrote:
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());Why are you doing that? Perhaps you should be doing this: $form->freeze(); $pdf->WriteHTML($form->toHTML());
$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)) {-- Justin Patrinreturn $res;} } How can I do that? Thanks a lot ZoTyA -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php