public function toText() {
     try {
         $this->pdf->Output($this->fileName.".pdf", "D");
     } catch (Gpf_Exception $e) {
         echo $this->_("Pdf output: %s", $e->getMessage());
     }
 }
 protected function setHeaderAndFooter() {
     $this->pdf->SetHeaderData();
     $this->pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $this->pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $this->pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); 
 }