[dev] question about File_PDF

Martin Luethi horde at humbapa.ch
Mon May 17 00:57:22 PDT 2004


hi list

I started to use the File_PDF-pear-class

I'm trying to use the header() and footer() methodes but somehow it does not
work as expected:

class mypdf extends File_PDF
{
   function header() {
      $this->line(20, 18, 168, 18);
   }
}
$pdf = mypdf::factory("P", "mm", "A4");

but like this my header-methode will never be called

I think it has something to do with the factory-methode in the class File_PDF:

function &factory($orientation = 'P', $unit = 'mm', $format = 'A4')
{
   ...SKIP...
   /* Create the PDF object. */
   $pdf = &new File_PDF();
   ...SKIP...
   return $pdf;
}

I'm not so familiar with classes and objects, but doesn't this methode return
an instance of the File_PDF-class and not an instance of my new mypdf-class?


thanks!

martin luethi


More information about the dev mailing list