Skip to content

Commit 65b3c81

Browse files
committed
Adapted to new FPDF version
1 parent a405b1d commit 65b3c81

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/wcmf/lib/pdf/PDF.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ class PDF extends Fpdi {
3333

3434
/**
3535
* Overridden to set the template on the page
36+
* TODO check if this is still necessary, if useTemplate is called in PDFTemplate::output() now
3637
*/
3738
public function Header() {
3839
parent::Header();
39-
$this->useTemplate($this->tpl);
40+
if ($this->currentTemplateId) {
41+
$this->useTemplate($this->currentTemplateId);
42+
}
4043
}
4144

4245
/**

src/wcmf/lib/pdf/PDFTemplate.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public function output($name='', $dest='') {
103103
// add each page
104104
$tplIndex = $this->pdf->ImportPage($i);
105105
$size = $this->pdf->getTemplatesize($tplIndex);
106-
$this->pdf->AddPage($size['h'] > $size['w'] ? 'P' : 'L');
106+
$this->pdf->AddPage($size['orientation']);
107+
$this->pdf->useTemplate($tplIndex);
107108

108109
// render the PDFPage onto the template page
109110
if ($pageIndex < sizeof($this->pages)) {

0 commit comments

Comments
 (0)