Hello Gianluca,

In may case, we put FPDF into vendors directory. Then we generate 
component php file, pdf_generator.php. In this php file, we define two 
classes. The first one is PdfGeneratorComponent class which is component 
class. The other is MyFPDF class which extends FPDF class.

The following is the brief example.

pdf_generator.php:
<?php
// in the setup.php file, we specify font path and a few elements.
vendor("fpdf/setup");
class PdfGeneratorComponent exnteds Object {
   function generate() {
     // code for generating pdf file using MyFPDF class object.
     ....
   }
}
class MyFPDF extends FPDF {
   // define some utility functions for generating pdf files.
   ....
}
?>

In the controller, we use this component as follows:

xxx_controller.php:
<?php
class XxxController {
   ...
   var $components = array('Pdf');
   ...
   function generate {
     $this->Pdf->generate();
     exit;
   }
}
?>


Best Wishes,

Takuo Shiono



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to