0

I like to call FPDF Construct class in Invoice class construct method. How can i call construct method of FPDF cass into Invoice class?

Invoice Class:

public function __construct($size='A4',$currency='$',$language='en') {
    $this->columns              = 4;
    $this->items                = array();
    $this->totals               = array();
    $this->addText              = array();
    $this->firstColumnWidth     = 70;
    $this->currency             = $currency;
    $this->maxImageDimensions   = array(230,130);
    $this->setLanguage($language);
    $this->setDocumentSize($size);
    $this->setColor("#222222");
    <!-- I want to call here fpdf construct class -->
    $this->FPDF('P','mm',array($this->document['w'],$this->document['h']));
    $this->AliasNbPages();
    $this->SetMargins($this->margins['l'],$this->margins['t'],$this->margins['r']);
}

FPDF class:

function __construct($orientation='P', $unit='mm', $size='A4')
{
    // Some checks
    $this->_dochecks();
    // Initialization of properties
    $this->state = 0;
    $this->page = 0;
    $this->n = 2;
    $this->buffer = '';
    $this->SetCompression(true);
    // Set default PDF version number
    $this->PDFVersion = '1.3';
}
fsuuaas
  • 165
  • 7

1 Answers1

0

By simply calling it:

parent::__construct('P','mm', array($this->document['w'],$this->document['h']));

See here for more details.

Jan Slabon
  • 4,736
  • 2
  • 14
  • 29