@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | // The last pictures page number |
68 | 68 | public int $lastpicpage = 0; |
69 | 69 | |
70 | - // The HEADER OR FOOTER to render |
|
70 | + // The HEADER OR FOOTER to render |
|
71 | 71 | public bool $isHeaderOrFooter = false; |
72 | 72 | |
73 | - //The breakpage header y |
|
74 | - public float $breakPageHeaderHeight = 0.0; |
|
73 | + //The breakpage header y |
|
74 | + public float $breakPageHeaderHeight = 0.0; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * PDF Header -PDF |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function header(): void //sfqas |
82 | 82 | { |
83 | 83 | $isHeaderOrFooter = true; |
84 | - foreach ($this->headerElements as $element) { |
|
84 | + foreach ($this->headerElements as $element) { |
|
85 | 85 | if ($element instanceof ReportBaseElement) { |
86 | 86 | $element->render($this,$isHeaderOrFooter); |
87 | 87 | } elseif ($element === 'footnotetexts') { |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | $this->newPage(); |
91 | 91 | } |
92 | 92 | } |
93 | - $isHeaderOrFooter = false; |
|
94 | - $this->breakPageHeaderHeight =$this->tcpdf->GetY(); |
|
93 | + $isHeaderOrFooter = false; |
|
94 | + $this->breakPageHeaderHeight =$this->tcpdf->GetY(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | public function body(): void // //sfqas |
103 | 103 | { |
104 | 104 | // $this->tcpdf->AddPage(); |
105 | - $this->newPage(); |
|
105 | + $this->newPage(); |
|
106 | 106 | foreach ($this->bodyElements as $element) { |
107 | 107 | if ($element instanceof ReportBaseElement) { |
108 | 108 | $element->render($this); |
@@ -142,16 +142,16 @@ discard block |
||
142 | 142 | public function footer(): void //sfqas |
143 | 143 | { |
144 | 144 | $isHeaderOrFooter = true; |
145 | - foreach ($this->footerElements as $element) { |
|
145 | + foreach ($this->footerElements as $element) { |
|
146 | 146 | if ($element instanceof ReportBaseElement) { |
147 | - $element->render($this,$isHeaderOrFooter); |
|
147 | + $element->render($this,$isHeaderOrFooter); |
|
148 | 148 | } elseif ($element === 'footnotetexts') { |
149 | 149 | $this->footnotes(); |
150 | 150 | } elseif ($element === 'addpage') { |
151 | 151 | $this->newPage(); |
152 | 152 | } |
153 | 153 | } |
154 | - $isHeaderOrFooter = false; |
|
154 | + $isHeaderOrFooter = false; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -335,11 +335,11 @@ discard block |
||
335 | 335 | } |
336 | 336 | $this->tcpdf->AddPage(); |
337 | 337 | |
338 | - $this->header(); |
|
339 | - // $this->tcpdf->setY($this->tcpdf->getPageHeight() - 75); |
|
340 | - $this->tcpdf->setY($this->tcpdf->getPageHeight()-$this->footer_margin-55); |
|
341 | - $this->footer(); |
|
342 | - $this->tcpdf->setY($this->breakPageHeaderHeight); |
|
338 | + $this->header(); |
|
339 | + // $this->tcpdf->setY($this->tcpdf->getPageHeight() - 75); |
|
340 | + $this->tcpdf->setY($this->tcpdf->getPageHeight()-$this->footer_margin-55); |
|
341 | + $this->footer(); |
|
342 | + $this->tcpdf->setY($this->breakPageHeaderHeight); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -352,19 +352,19 @@ discard block |
||
352 | 352 | public function checkPageBreakPDF(float $height): bool // // //sfqas |
353 | 353 | { |
354 | 354 | // return $this->tcpdf->checkPageBreak($height); |
355 | - $isPageBreaked = false; |
|
356 | - if(!$this->isHeaderOrFooter){ |
|
357 | - $isPageBreaked = $this->tcpdf->checkPageBreak($height); |
|
358 | - $this->tcpdf->setY($this->header_margin); |
|
359 | - $this->header(); |
|
360 | - // $this->tcpdf->setY($this->tcpdf->getPageHeight() - 75); |
|
361 | - $this->tcpdf->setY($this->tcpdf->getPageHeight()-$this->footer_margin-55); |
|
362 | - $this->footer(); |
|
363 | - $this->tcpdf->setY($this->breakPageHeaderHeight); |
|
364 | - return $isPageBreaked ; |
|
365 | - }else{ |
|
366 | - return false; |
|
367 | - } |
|
355 | + $isPageBreaked = false; |
|
356 | + if(!$this->isHeaderOrFooter){ |
|
357 | + $isPageBreaked = $this->tcpdf->checkPageBreak($height); |
|
358 | + $this->tcpdf->setY($this->header_margin); |
|
359 | + $this->header(); |
|
360 | + // $this->tcpdf->setY($this->tcpdf->getPageHeight() - 75); |
|
361 | + $this->tcpdf->setY($this->tcpdf->getPageHeight()-$this->footer_margin-55); |
|
362 | + $this->footer(); |
|
363 | + $this->tcpdf->setY($this->breakPageHeaderHeight); |
|
364 | + return $isPageBreaked ; |
|
365 | + }else{ |
|
366 | + return false; |
|
367 | + } |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -408,9 +408,9 @@ discard block |
||
408 | 408 | $this->tcpdf->setKeywords($this->rkeywords); |
409 | 409 | $this->tcpdf->setHeaderData('', 0, $this->title); |
410 | 410 | $this->tcpdf->setHeaderFont([$this->default_font, '', $this->default_font_size]); |
411 | - // // remove default header/footer |
|
412 | - $this->tcpdf->setPrintHeader(false); |
|
413 | - $this->tcpdf->setPrintFooter(false); |
|
411 | + // // remove default header/footer |
|
412 | + $this->tcpdf->setPrintHeader(false); |
|
413 | + $this->tcpdf->setPrintFooter(false); |
|
414 | 414 | |
415 | 415 | if ($this->show_generated_by) { |
416 | 416 | // The default style name for Generated by.... is 'genby' |
@@ -126,11 +126,11 @@ |
||
126 | 126 | } |
127 | 127 | // Add a new page if needed |
128 | 128 | //sfqas |
129 | - if ($renderer->tcpdf->checkPageBreak($cHT,null,false) and !$headerorfoot){ |
|
130 | - if ($renderer->checkPageBreakPDF($cHT)) { |
|
131 | - $this->top = $renderer->tcpdf->GetY(); |
|
132 | - } |
|
133 | - } |
|
129 | + if ($renderer->tcpdf->checkPageBreak($cHT,null,false) and !$headerorfoot){ |
|
130 | + if ($renderer->checkPageBreakPDF($cHT)) { |
|
131 | + $this->top = $renderer->tcpdf->GetY(); |
|
132 | + } |
|
133 | + } |
|
134 | 134 | $temptext = RightToLeftSupport::spanLtrRtl($temptext); |
135 | 135 | } |
136 | 136 | // HTML ready - last value is true |
@@ -38,7 +38,7 @@ |
||
38 | 38 | // Check for a pagebreak first |
39 | 39 | if ($renderer->tcpdf->checkPageBreak($this->height + 5,null,false) and !$headerorfoot){ //sfqas |
40 | 40 | $renderer->checkPageBreakPDF($this->height + 5); |
41 | - $this->y = $renderer->tcpdf->GetY(); |
|
41 | + $this->y = $renderer->tcpdf->GetY(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $curx = $renderer->tcpdf->GetX(); |
@@ -225,12 +225,12 @@ |
||
225 | 225 | // Add a new page if needed |
226 | 226 | if ($this->pagecheck) { |
227 | 227 | if ($renderer->tcpdf->checkPageBreak($cH,null,false) and !$headerorfoot){ |
228 | - // Reset last cell height or Header/Footer will inherit it, in case of pagebreak |
|
229 | - $renderer->lastCellHeight = 0; |
|
230 | - if ($renderer->checkPageBreakPDF($cH)) { |
|
231 | - $cY = $renderer->tcpdf->GetY(); |
|
228 | + // Reset last cell height or Header/Footer will inherit it, in case of pagebreak |
|
229 | + $renderer->lastCellHeight = 0; |
|
230 | + if ($renderer->checkPageBreakPDF($cH)) { |
|
231 | + $cY = $renderer->tcpdf->GetY(); |
|
232 | + } |
|
232 | 233 | } |
233 | - } |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | // Setup the border and background color |