useGroupNumbers = $value; } public function setHeaderHtml($html) { $this->headerHtml = $html; } public function setFooterHtml($html) { $this->footerHtml = $html; } public function setFooterPosition($position) { $this->footerPosition = $position; } public function setHeaderPosition($position) { $this->headerPosition = $position; } public function Header() { $this->SetY($this->headerPosition); $html = $this->headerHtml; if ($this->useGroupNumbers) { $html = str_replace('{pageNumber}', '{{:png:}}', $html); $html = str_replace('{pageAbsoluteNumber}', '{{:pnp:}}', $html); } else { $html = str_replace('{pageNumber}', '{{:pnp:}}', $html); $html = str_replace('{pageAbsoluteNumber}', '{{:pnp:}}', $html); } if ($this->isUnicodeFont()) { $html = str_replace('{totalPageNumber}', '{{:ptp:}}', $html); } else { $html = str_replace('{totalPageNumber}', '{:ptp:}', $html); } $this->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, '', 0, false, 'T'); } public function Footer() { $breakMargin = $this->getBreakMargin(); $autoPageBreak = $this->AutoPageBreak; $this->SetAutoPageBreak(false, 0); $this->SetY((-1) * $this->footerPosition); $html = $this->footerHtml; if ($this->useGroupNumbers) { $html = str_replace('{pageNumber}', '{{:png:}}', $html); $html = str_replace('{pageAbsoluteNumber}', '{{:pnp:}}', $html); } else { $html = str_replace('{pageNumber}', '{{:pnp:}}', $html); $html = str_replace('{pageAbsoluteNumber}', '{{:pnp:}}', $html); } if ($this->isUnicodeFont()) { $html = str_replace('{totalPageNumber}', '{{:ptp:}}', $html); } else { $html = str_replace('{totalPageNumber}', '{:ptp:}', $html); } $this->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, '', 0, false, 'T'); $this->SetAutoPageBreak($autoPageBreak, $breakMargin); } public function Output($name = 'doc.pdf', $dest = 'I') { if ($dest === 'I' && !$this->sign && php_sapi_name() != 'cli') { if ($this->state < 3) { $this->Close(); } $name = preg_replace('/[\s]+/', '_', $name); $name = Util::sanitizeFileName($name); if (ob_get_contents()) { $this->Error('Some data has already been output, can\'t send PDF file'); } header('Content-Type: application/pdf'); if (headers_sent()) { $this->Error('Some data has already been output to browser, can\'t send PDF file'); } header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1'); header('Pragma: public'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Content-Disposition: inline; filename="'.$name.'"'); TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); return ''; } return parent::Output($name, $dest); } }