For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2005 > Re: [PEAR] FIle_PDF









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] FIle_PDF
Marko Djukic

2005-06-06, 8:56 am

Quoting Danny Brow <dan@fullmotions.com>:

> Anyone have a working example of the File_PDF class?
>
> Thanks,
> Dan.
>


<?php
include 'File/PDF.php';

$pdf = &File_PDF::factory();

$pdf->addPage();
$pdf->setFont('Arial', '', 16);
$pdf->setDrawColor('rgb', 50,0,0);
$pdf->setFillColor('rgb', 0,0,50);

$pdf->text(100, 50, "TEXT");

$pdf->addPage();
$pdf->text(100, 150, "TEXT2");

$success = $pdf->output('mypdf.pdf');
if (is_a($success, 'PEAR_Error')) {
echo $success->getMessage();
}


--
Marko Djukic - Oblo Project
http://www.oblo.com/
tel: +39 055 343 4252
mob: +39 347 007 6313
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com