1 | <?php |
---|
2 | /* |
---|
3 | Copyright DHTMLX LTD. http://www.dhtmlx.com |
---|
4 | */ |
---|
5 | |
---|
6 | |
---|
7 | require_once('./tcpdf/tcpdf.php'); |
---|
8 | |
---|
9 | class TCPDFExt extends TCPDF { |
---|
10 | |
---|
11 | public function Footer() { |
---|
12 | $cur_y = $this->GetY(); |
---|
13 | $ormargins = $this->getOriginalMargins(); |
---|
14 | $this->SetTextColor(0, 0, 0); |
---|
15 | //set style for cell border |
---|
16 | $line_width = 0.85 / $this->getScaleFactor(); |
---|
17 | $this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); |
---|
18 | //print document barcode |
---|
19 | $barcode = $this->getBarcode(); |
---|
20 | if (!empty($barcode)) { |
---|
21 | $this->Ln($line_width); |
---|
22 | $barcode_width = round(($this->getPageWidth() - $ormargins['left'] - $ormargins['right'])/3); |
---|
23 | $this->write1DBarcode($barcode, 'C128B', $this->GetX(), $cur_y + $line_width, $barcode_width, (($this->getFooterMargin() / 3) - $line_width), 0.3, '', ''); |
---|
24 | } |
---|
25 | if (empty($this->pagegroups)) { |
---|
26 | $pagenumtxt = $this->l['w_page'].' '.$this->getAliasNumPage().' / '.$this->getAliasNbPages(); |
---|
27 | } else { |
---|
28 | $pagenumtxt = $this->l['w_page'].' '.$this->getPageNumGroupAlias().' / '.$this->getPageGroupAlias(); |
---|
29 | } |
---|
30 | $this->SetY($cur_y); |
---|
31 | //Print page number |
---|
32 | if ($this->getRTL()) { |
---|
33 | $this->SetX($ormargins['right']); |
---|
34 | $this->Cell(0, 0, $pagenumtxt, 0, 0, 'L'); |
---|
35 | } else { |
---|
36 | $this->SetX($ormargins['left']); |
---|
37 | $this->Cell(0, 0, $pagenumtxt, 0, 0, 'R'); |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | } |
---|
42 | |
---|
43 | ?> |
---|