Possible Duplicate:
Declaration of Methods should be Compatible with Parent Methods in PHP
I am implementing PDF (Zend_Pdf_Table), downloaded from SourceForge
now the problem is that its giving me following errors.
Error 1=Strict Standards: Declaration of My_Pdf_Document::save() should be compatible
with that of Zend_Pdf::save() in D:\SVN data\WebClient_PHP\trunk\library
\My\Pdf\Document.php on line 2
Line#2 is
class My_Pdf_Document extends My_Pdf{
the second error is
Error 2=Fatal error: Declaration of My_Pdf_Page::drawImage() must be compatible with
that of Zend_Pdf_Canvas_Interface::drawImage() in D:\SVN data\WebClient_PHP\trunk
\library\My\Pdf\Page.php on line 369
some code from my action
$instance = new abc();
$select = $instance->Get_xyz($p);
try {
// create PDF
$pdf = new My_Pdf_Document('Call Logs Details.pdf', '.');
// create page
$page = $pdf->createPage();
// define font resource
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
// set font
$page->setFont($font, 24);
// create table
$table = new My_Pdf_Table(3);
// iterate over record set
// set up table content
while ($record = $select->fetch()) {
$row = new My_Pdf_Table_Row();
$cols = array();
foreach ($record as $k => $v) {
$col = new My_Pdf_Table_Column();
$col->setText($v);
$cols[] = $col;
}
$row->setColumns($cols);
$row->setFont($font, 14);
$row->setBorder(My_Pdf::TOP, new Zend_Pdf_Style());
$row->setBorder(My_Pdf::BOTTOM, new Zend_Pdf_Style());
$row->setBorder(My_Pdf::LEFT, new Zend_Pdf_Style());
$row->setCellPaddings(array(10,10,10,10));
$table->addRow($row);
}
// add table to page
$page->addTable($table, 0, 0);
// add page to document
$pdf->addPage($page);
// save as file
$pdf->save();
echo 'SUCCESS: Document saved!';
} catch (Zend_Pdf_Exception $e) {
die ('PDF error: ' . $e->getMessage());
} catch (Exception $e) {
die ('Application error: ' . $e->getMessage());
}
Any idea why i am getting following errors.What i am missing ?? i am using latest Zend framework.