我喜欢在发票类的构造方法中调用FPDF构造类。如何将FPDF cass的构造方法调用到发票类中?
发票类别:
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类:
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';
}发布于 2017-11-22 15:11:14
通过简单地调用它:
parent::__construct('P','mm', array($this->document['w'],$this->document['h']));有关更多详细信息,请参阅here。
https://stackoverflow.com/questions/47416361
复制相似问题