@@ -26,7 +26,7 @@ |
||
| 26 | 26 | protected $yDados = 0; |
| 27 | 27 | protected $xml; // string XML NFe |
| 28 | 28 | protected $errMsg = ''; // mesagens de erro |
| 29 | - protected $errStatus = false;// status de erro TRUE um erro ocorreu false sem erros |
|
| 29 | + protected $errStatus = false; // status de erro TRUE um erro ocorreu false sem erros |
|
| 30 | 30 | protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
| 31 | 31 | protected $margemInterna = 2; |
| 32 | 32 | protected $id; |
@@ -1278,8 +1278,7 @@ discard block |
||
| 1278 | 1278 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1279 | 1279 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1280 | 1280 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1281 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1282 | - ''; |
|
| 1281 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1283 | 1282 | } else { |
| 1284 | 1283 | $texto = ''; |
| 1285 | 1284 | } |
@@ -1375,8 +1374,7 @@ discard block |
||
| 1375 | 1374 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1376 | 1375 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1377 | 1376 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1378 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1379 | - ''; |
|
| 1377 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1380 | 1378 | } else { |
| 1381 | 1379 | $texto = ''; |
| 1382 | 1380 | } |
@@ -1632,7 +1630,7 @@ discard block |
||
| 1632 | 1630 | $qCarga = 0; |
| 1633 | 1631 | foreach ($this->infQ as $infQ) { |
| 1634 | 1632 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
| 1635 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1633 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1636 | 1634 | } |
| 1637 | 1635 | } |
| 1638 | 1636 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -1649,7 +1647,7 @@ discard block |
||
| 1649 | 1647 | $qCarga = 0; |
| 1650 | 1648 | foreach ($this->infQ as $infQ) { |
| 1651 | 1649 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
| 1652 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1650 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1653 | 1651 | } |
| 1654 | 1652 | } |
| 1655 | 1653 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -6,129 +6,129 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class Pdf extends Fpdf |
| 8 | 8 | { |
| 9 | - private $t128; // tabela de codigos 128 |
|
| 10 | - private $abcSet=""; // conjunto de caracteres legiveis em 128 |
|
| 11 | - private $aSet=""; // grupo A do conjunto de de caracteres legiveis |
|
| 12 | - private $bSet=""; // grupo B do conjunto de caracteres legiveis |
|
| 13 | - private $cSet=""; // grupo C do conjunto de caracteres legiveis |
|
| 14 | - private $setFrom; // converter de |
|
| 15 | - private $setTo; // converter para |
|
| 16 | - private $jStart = ["A"=>103, "B"=>104, "C"=>105]; // Caracteres de seleção do grupo 128 |
|
| 17 | - private $jSwap = ["A"=>101, "B"=>100, "C"=>99]; // Caracteres de troca de grupo |
|
| 9 | + private $t128; // tabela de codigos 128 |
|
| 10 | + private $abcSet = ""; // conjunto de caracteres legiveis em 128 |
|
| 11 | + private $aSet = ""; // grupo A do conjunto de de caracteres legiveis |
|
| 12 | + private $bSet = ""; // grupo B do conjunto de caracteres legiveis |
|
| 13 | + private $cSet = ""; // grupo C do conjunto de caracteres legiveis |
|
| 14 | + private $setFrom; // converter de |
|
| 15 | + private $setTo; // converter para |
|
| 16 | + private $jStart = ["A"=>103, "B"=>104, "C"=>105]; // Caracteres de seleção do grupo 128 |
|
| 17 | + private $jSwap = ["A"=>101, "B"=>100, "C"=>99]; // Caracteres de troca de grupo |
|
| 18 | 18 | |
| 19 | 19 | public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4') |
| 20 | 20 | { |
| 21 | 21 | //passar parametros para a classe principal |
| 22 | 22 | parent::__construct($orientation, $unit, $format); |
| 23 | 23 | // composição dos caracteres do barcode 128 |
| 24 | - $this->t128[] = array(2, 1, 2, 2, 2, 2); //0 : [ ] |
|
| 25 | - $this->t128[] = array(2, 2, 2, 1, 2, 2); //1 : [!] |
|
| 26 | - $this->t128[] = array(2, 2, 2, 2, 2, 1); //2 : ["] |
|
| 27 | - $this->t128[] = array(1, 2, 1, 2, 2, 3); //3 : [#] |
|
| 28 | - $this->t128[] = array(1, 2, 1, 3, 2, 2); //4 : [$] |
|
| 29 | - $this->t128[] = array(1, 3, 1, 2, 2, 2); //5 : [%] |
|
| 30 | - $this->t128[] = array(1, 2, 2, 2, 1, 3); //6 : [&] |
|
| 31 | - $this->t128[] = array(1, 2, 2, 3, 1, 2); //7 : ['] |
|
| 32 | - $this->t128[] = array(1, 3, 2, 2, 1, 2); //8 : [(] |
|
| 33 | - $this->t128[] = array(2, 2, 1, 2, 1, 3); //9 : [)] |
|
| 34 | - $this->t128[] = array(2, 2, 1, 3, 1, 2); //10 : [*] |
|
| 35 | - $this->t128[] = array(2, 3, 1, 2, 1, 2); //11 : [+] |
|
| 36 | - $this->t128[] = array(1, 1, 2, 2, 3, 2); //12 : [,] |
|
| 37 | - $this->t128[] = array(1, 2, 2, 1, 3, 2); //13 : [-] |
|
| 38 | - $this->t128[] = array(1, 2, 2, 2, 3, 1); //14 : [.] |
|
| 39 | - $this->t128[] = array(1, 1, 3, 2, 2, 2); //15 : [/] |
|
| 40 | - $this->t128[] = array(1, 2, 3, 1, 2, 2); //16 : [0] |
|
| 41 | - $this->t128[] = array(1, 2, 3, 2, 2, 1); //17 : [1] |
|
| 42 | - $this->t128[] = array(2, 2, 3, 2, 1, 1); //18 : [2] |
|
| 43 | - $this->t128[] = array(2, 2, 1, 1, 3, 2); //19 : [3] |
|
| 44 | - $this->t128[] = array(2, 2, 1, 2, 3, 1); //20 : [4] |
|
| 45 | - $this->t128[] = array(2, 1, 3, 2, 1, 2); //21 : [5] |
|
| 46 | - $this->t128[] = array(2, 2, 3, 1, 1, 2); //22 : [6] |
|
| 47 | - $this->t128[] = array(3, 1, 2, 1, 3, 1); //23 : [7] |
|
| 48 | - $this->t128[] = array(3, 1, 1, 2, 2, 2); //24 : [8] |
|
| 49 | - $this->t128[] = array(3, 2, 1, 1, 2, 2); //25 : [9] |
|
| 50 | - $this->t128[] = array(3, 2, 1, 2, 2, 1); //26 : [:] |
|
| 51 | - $this->t128[] = array(3, 1, 2, 2, 1, 2); //27 : [;] |
|
| 52 | - $this->t128[] = array(3, 2, 2, 1, 1, 2); //28 : [<] |
|
| 53 | - $this->t128[] = array(3, 2, 2, 2, 1, 1); //29 : [=] |
|
| 54 | - $this->t128[] = array(2, 1, 2, 1, 2, 3); //30 : [>] |
|
| 55 | - $this->t128[] = array(2, 1, 2, 3, 2, 1); //31 : [?] |
|
| 56 | - $this->t128[] = array(2, 3, 2, 1, 2, 1); //32 : [@] |
|
| 57 | - $this->t128[] = array(1, 1, 1, 3, 2, 3); //33 : [A] |
|
| 58 | - $this->t128[] = array(1, 3, 1, 1, 2, 3); //34 : [B] |
|
| 59 | - $this->t128[] = array(1, 3, 1, 3, 2, 1); //35 : [C] |
|
| 60 | - $this->t128[] = array(1, 1, 2, 3, 1, 3); //36 : [D] |
|
| 61 | - $this->t128[] = array(1, 3, 2, 1, 1, 3); //37 : [E] |
|
| 62 | - $this->t128[] = array(1, 3, 2, 3, 1, 1); //38 : [F] |
|
| 63 | - $this->t128[] = array(2, 1, 1, 3, 1, 3); //39 : [G] |
|
| 64 | - $this->t128[] = array(2, 3, 1, 1, 1, 3); //40 : [H] |
|
| 65 | - $this->t128[] = array(2, 3, 1, 3, 1, 1); //41 : [I] |
|
| 66 | - $this->t128[] = array(1, 1, 2, 1, 3, 3); //42 : [J] |
|
| 67 | - $this->t128[] = array(1, 1, 2, 3, 3, 1); //43 : [K] |
|
| 68 | - $this->t128[] = array(1, 3, 2, 1, 3, 1); //44 : [L] |
|
| 69 | - $this->t128[] = array(1, 1, 3, 1, 2, 3); //45 : [M] |
|
| 70 | - $this->t128[] = array(1, 1, 3, 3, 2, 1); //46 : [N] |
|
| 71 | - $this->t128[] = array(1, 3, 3, 1, 2, 1); //47 : [O] |
|
| 72 | - $this->t128[] = array(3, 1, 3, 1, 2, 1); //48 : [P] |
|
| 73 | - $this->t128[] = array(2, 1, 1, 3, 3, 1); //49 : [Q] |
|
| 74 | - $this->t128[] = array(2, 3, 1, 1, 3, 1); //50 : [R] |
|
| 75 | - $this->t128[] = array(2, 1, 3, 1, 1, 3); //51 : [S] |
|
| 76 | - $this->t128[] = array(2, 1, 3, 3, 1, 1); //52 : [T] |
|
| 77 | - $this->t128[] = array(2, 1, 3, 1, 3, 1); //53 : [U] |
|
| 78 | - $this->t128[] = array(3, 1, 1, 1, 2, 3); //54 : [V] |
|
| 79 | - $this->t128[] = array(3, 1, 1, 3, 2, 1); //55 : [W] |
|
| 80 | - $this->t128[] = array(3, 3, 1, 1, 2, 1); //56 : [X] |
|
| 81 | - $this->t128[] = array(3, 1, 2, 1, 1, 3); //57 : [Y] |
|
| 82 | - $this->t128[] = array(3, 1, 2, 3, 1, 1); //58 : [Z] |
|
| 83 | - $this->t128[] = array(3, 3, 2, 1, 1, 1); //59 : [[] |
|
| 84 | - $this->t128[] = array(3, 1, 4, 1, 1, 1); //60 : [\] |
|
| 85 | - $this->t128[] = array(2, 2, 1, 4, 1, 1); //61 : []] |
|
| 86 | - $this->t128[] = array(4, 3, 1, 1, 1, 1); //62 : [^] |
|
| 87 | - $this->t128[] = array(1, 1, 1, 2, 2, 4); //63 : [_] |
|
| 88 | - $this->t128[] = array(1, 1, 1, 4, 2, 2); //64 : [`] |
|
| 89 | - $this->t128[] = array(1, 2, 1, 1, 2, 4); //65 : [a] |
|
| 90 | - $this->t128[] = array(1, 2, 1, 4, 2, 1); //66 : [b] |
|
| 91 | - $this->t128[] = array(1, 4, 1, 1, 2, 2); //67 : [c] |
|
| 92 | - $this->t128[] = array(1, 4, 1, 2, 2, 1); //68 : [d] |
|
| 93 | - $this->t128[] = array(1, 1, 2, 2, 1, 4); //69 : [e] |
|
| 94 | - $this->t128[] = array(1, 1, 2, 4, 1, 2); //70 : [f] |
|
| 95 | - $this->t128[] = array(1, 2, 2, 1, 1, 4); //71 : [g] |
|
| 96 | - $this->t128[] = array(1, 2, 2, 4, 1, 1); //72 : [h] |
|
| 97 | - $this->t128[] = array(1, 4, 2, 1, 1, 2); //73 : [i] |
|
| 98 | - $this->t128[] = array(1, 4, 2, 2, 1, 1); //74 : [j] |
|
| 99 | - $this->t128[] = array(2, 4, 1, 2, 1, 1); //75 : [k] |
|
| 100 | - $this->t128[] = array(2, 2, 1, 1, 1, 4); //76 : [l] |
|
| 101 | - $this->t128[] = array(4, 1, 3, 1, 1, 1); //77 : [m] |
|
| 102 | - $this->t128[] = array(2, 4, 1, 1, 1, 2); //78 : [n] |
|
| 103 | - $this->t128[] = array(1, 3, 4, 1, 1, 1); //79 : [o] |
|
| 104 | - $this->t128[] = array(1, 1, 1, 2, 4, 2); //80 : [p] |
|
| 105 | - $this->t128[] = array(1, 2, 1, 1, 4, 2); //81 : [q] |
|
| 106 | - $this->t128[] = array(1, 2, 1, 2, 4, 1); //82 : [r] |
|
| 107 | - $this->t128[] = array(1, 1, 4, 2, 1, 2); //83 : [s] |
|
| 108 | - $this->t128[] = array(1, 2, 4, 1, 1, 2); //84 : [t] |
|
| 109 | - $this->t128[] = array(1, 2, 4, 2, 1, 1); //85 : [u] |
|
| 110 | - $this->t128[] = array(4, 1, 1, 2, 1, 2); //86 : [v] |
|
| 111 | - $this->t128[] = array(4, 2, 1, 1, 1, 2); //87 : [w] |
|
| 112 | - $this->t128[] = array(4, 2, 1, 2, 1, 1); //88 : [x] |
|
| 113 | - $this->t128[] = array(2, 1, 2, 1, 4, 1); //89 : [y] |
|
| 114 | - $this->t128[] = array(2, 1, 4, 1, 2, 1); //90 : [z] |
|
| 115 | - $this->t128[] = array(4, 1, 2, 1, 2, 1); //91 : [{] |
|
| 116 | - $this->t128[] = array(1, 1, 1, 1, 4, 3); //92 : [|] |
|
| 117 | - $this->t128[] = array(1, 1, 1, 3, 4, 1); //93 : [}] |
|
| 118 | - $this->t128[] = array(1, 3, 1, 1, 4, 1); //94 : [~] |
|
| 119 | - $this->t128[] = array(1, 1, 4, 1, 1, 3); //95 : [DEL] |
|
| 120 | - $this->t128[] = array(1, 1, 4, 3, 1, 1); //96 : [FNC3] |
|
| 121 | - $this->t128[] = array(4, 1, 1, 1, 1, 3); //97 : [FNC2] |
|
| 122 | - $this->t128[] = array(4, 1, 1, 3, 1, 1); //98 : [SHIFT] |
|
| 123 | - $this->t128[] = array(1, 1, 3, 1, 4, 1); //99 : [Cswap] |
|
| 124 | - $this->t128[] = array(1, 1, 4, 1, 3, 1); //100 : [Bswap] |
|
| 125 | - $this->t128[] = array(3, 1, 1, 1, 4, 1); //101 : [Aswap] |
|
| 126 | - $this->t128[] = array(4, 1, 1, 1, 3, 1); //102 : [FNC1] |
|
| 127 | - $this->t128[] = array(2, 1, 1, 4, 1, 2); //103 : [Astart] |
|
| 128 | - $this->t128[] = array(2, 1, 1, 2, 1, 4); //104 : [Bstart] |
|
| 129 | - $this->t128[] = array(2, 1, 1, 2, 3, 2); //105 : [Cstart] |
|
| 130 | - $this->t128[] = array(2, 3, 3, 1, 1, 1); //106 : [STOP] |
|
| 131 | - $this->t128[] = array(2, 1); //107 : [END BAR] |
|
| 24 | + $this->t128[] = array(2, 1, 2, 2, 2, 2); //0 : [ ] |
|
| 25 | + $this->t128[] = array(2, 2, 2, 1, 2, 2); //1 : [!] |
|
| 26 | + $this->t128[] = array(2, 2, 2, 2, 2, 1); //2 : ["] |
|
| 27 | + $this->t128[] = array(1, 2, 1, 2, 2, 3); //3 : [#] |
|
| 28 | + $this->t128[] = array(1, 2, 1, 3, 2, 2); //4 : [$] |
|
| 29 | + $this->t128[] = array(1, 3, 1, 2, 2, 2); //5 : [%] |
|
| 30 | + $this->t128[] = array(1, 2, 2, 2, 1, 3); //6 : [&] |
|
| 31 | + $this->t128[] = array(1, 2, 2, 3, 1, 2); //7 : ['] |
|
| 32 | + $this->t128[] = array(1, 3, 2, 2, 1, 2); //8 : [(] |
|
| 33 | + $this->t128[] = array(2, 2, 1, 2, 1, 3); //9 : [)] |
|
| 34 | + $this->t128[] = array(2, 2, 1, 3, 1, 2); //10 : [*] |
|
| 35 | + $this->t128[] = array(2, 3, 1, 2, 1, 2); //11 : [+] |
|
| 36 | + $this->t128[] = array(1, 1, 2, 2, 3, 2); //12 : [,] |
|
| 37 | + $this->t128[] = array(1, 2, 2, 1, 3, 2); //13 : [-] |
|
| 38 | + $this->t128[] = array(1, 2, 2, 2, 3, 1); //14 : [.] |
|
| 39 | + $this->t128[] = array(1, 1, 3, 2, 2, 2); //15 : [/] |
|
| 40 | + $this->t128[] = array(1, 2, 3, 1, 2, 2); //16 : [0] |
|
| 41 | + $this->t128[] = array(1, 2, 3, 2, 2, 1); //17 : [1] |
|
| 42 | + $this->t128[] = array(2, 2, 3, 2, 1, 1); //18 : [2] |
|
| 43 | + $this->t128[] = array(2, 2, 1, 1, 3, 2); //19 : [3] |
|
| 44 | + $this->t128[] = array(2, 2, 1, 2, 3, 1); //20 : [4] |
|
| 45 | + $this->t128[] = array(2, 1, 3, 2, 1, 2); //21 : [5] |
|
| 46 | + $this->t128[] = array(2, 2, 3, 1, 1, 2); //22 : [6] |
|
| 47 | + $this->t128[] = array(3, 1, 2, 1, 3, 1); //23 : [7] |
|
| 48 | + $this->t128[] = array(3, 1, 1, 2, 2, 2); //24 : [8] |
|
| 49 | + $this->t128[] = array(3, 2, 1, 1, 2, 2); //25 : [9] |
|
| 50 | + $this->t128[] = array(3, 2, 1, 2, 2, 1); //26 : [:] |
|
| 51 | + $this->t128[] = array(3, 1, 2, 2, 1, 2); //27 : [;] |
|
| 52 | + $this->t128[] = array(3, 2, 2, 1, 1, 2); //28 : [<] |
|
| 53 | + $this->t128[] = array(3, 2, 2, 2, 1, 1); //29 : [=] |
|
| 54 | + $this->t128[] = array(2, 1, 2, 1, 2, 3); //30 : [>] |
|
| 55 | + $this->t128[] = array(2, 1, 2, 3, 2, 1); //31 : [?] |
|
| 56 | + $this->t128[] = array(2, 3, 2, 1, 2, 1); //32 : [@] |
|
| 57 | + $this->t128[] = array(1, 1, 1, 3, 2, 3); //33 : [A] |
|
| 58 | + $this->t128[] = array(1, 3, 1, 1, 2, 3); //34 : [B] |
|
| 59 | + $this->t128[] = array(1, 3, 1, 3, 2, 1); //35 : [C] |
|
| 60 | + $this->t128[] = array(1, 1, 2, 3, 1, 3); //36 : [D] |
|
| 61 | + $this->t128[] = array(1, 3, 2, 1, 1, 3); //37 : [E] |
|
| 62 | + $this->t128[] = array(1, 3, 2, 3, 1, 1); //38 : [F] |
|
| 63 | + $this->t128[] = array(2, 1, 1, 3, 1, 3); //39 : [G] |
|
| 64 | + $this->t128[] = array(2, 3, 1, 1, 1, 3); //40 : [H] |
|
| 65 | + $this->t128[] = array(2, 3, 1, 3, 1, 1); //41 : [I] |
|
| 66 | + $this->t128[] = array(1, 1, 2, 1, 3, 3); //42 : [J] |
|
| 67 | + $this->t128[] = array(1, 1, 2, 3, 3, 1); //43 : [K] |
|
| 68 | + $this->t128[] = array(1, 3, 2, 1, 3, 1); //44 : [L] |
|
| 69 | + $this->t128[] = array(1, 1, 3, 1, 2, 3); //45 : [M] |
|
| 70 | + $this->t128[] = array(1, 1, 3, 3, 2, 1); //46 : [N] |
|
| 71 | + $this->t128[] = array(1, 3, 3, 1, 2, 1); //47 : [O] |
|
| 72 | + $this->t128[] = array(3, 1, 3, 1, 2, 1); //48 : [P] |
|
| 73 | + $this->t128[] = array(2, 1, 1, 3, 3, 1); //49 : [Q] |
|
| 74 | + $this->t128[] = array(2, 3, 1, 1, 3, 1); //50 : [R] |
|
| 75 | + $this->t128[] = array(2, 1, 3, 1, 1, 3); //51 : [S] |
|
| 76 | + $this->t128[] = array(2, 1, 3, 3, 1, 1); //52 : [T] |
|
| 77 | + $this->t128[] = array(2, 1, 3, 1, 3, 1); //53 : [U] |
|
| 78 | + $this->t128[] = array(3, 1, 1, 1, 2, 3); //54 : [V] |
|
| 79 | + $this->t128[] = array(3, 1, 1, 3, 2, 1); //55 : [W] |
|
| 80 | + $this->t128[] = array(3, 3, 1, 1, 2, 1); //56 : [X] |
|
| 81 | + $this->t128[] = array(3, 1, 2, 1, 1, 3); //57 : [Y] |
|
| 82 | + $this->t128[] = array(3, 1, 2, 3, 1, 1); //58 : [Z] |
|
| 83 | + $this->t128[] = array(3, 3, 2, 1, 1, 1); //59 : [[] |
|
| 84 | + $this->t128[] = array(3, 1, 4, 1, 1, 1); //60 : [\] |
|
| 85 | + $this->t128[] = array(2, 2, 1, 4, 1, 1); //61 : []] |
|
| 86 | + $this->t128[] = array(4, 3, 1, 1, 1, 1); //62 : [^] |
|
| 87 | + $this->t128[] = array(1, 1, 1, 2, 2, 4); //63 : [_] |
|
| 88 | + $this->t128[] = array(1, 1, 1, 4, 2, 2); //64 : [`] |
|
| 89 | + $this->t128[] = array(1, 2, 1, 1, 2, 4); //65 : [a] |
|
| 90 | + $this->t128[] = array(1, 2, 1, 4, 2, 1); //66 : [b] |
|
| 91 | + $this->t128[] = array(1, 4, 1, 1, 2, 2); //67 : [c] |
|
| 92 | + $this->t128[] = array(1, 4, 1, 2, 2, 1); //68 : [d] |
|
| 93 | + $this->t128[] = array(1, 1, 2, 2, 1, 4); //69 : [e] |
|
| 94 | + $this->t128[] = array(1, 1, 2, 4, 1, 2); //70 : [f] |
|
| 95 | + $this->t128[] = array(1, 2, 2, 1, 1, 4); //71 : [g] |
|
| 96 | + $this->t128[] = array(1, 2, 2, 4, 1, 1); //72 : [h] |
|
| 97 | + $this->t128[] = array(1, 4, 2, 1, 1, 2); //73 : [i] |
|
| 98 | + $this->t128[] = array(1, 4, 2, 2, 1, 1); //74 : [j] |
|
| 99 | + $this->t128[] = array(2, 4, 1, 2, 1, 1); //75 : [k] |
|
| 100 | + $this->t128[] = array(2, 2, 1, 1, 1, 4); //76 : [l] |
|
| 101 | + $this->t128[] = array(4, 1, 3, 1, 1, 1); //77 : [m] |
|
| 102 | + $this->t128[] = array(2, 4, 1, 1, 1, 2); //78 : [n] |
|
| 103 | + $this->t128[] = array(1, 3, 4, 1, 1, 1); //79 : [o] |
|
| 104 | + $this->t128[] = array(1, 1, 1, 2, 4, 2); //80 : [p] |
|
| 105 | + $this->t128[] = array(1, 2, 1, 1, 4, 2); //81 : [q] |
|
| 106 | + $this->t128[] = array(1, 2, 1, 2, 4, 1); //82 : [r] |
|
| 107 | + $this->t128[] = array(1, 1, 4, 2, 1, 2); //83 : [s] |
|
| 108 | + $this->t128[] = array(1, 2, 4, 1, 1, 2); //84 : [t] |
|
| 109 | + $this->t128[] = array(1, 2, 4, 2, 1, 1); //85 : [u] |
|
| 110 | + $this->t128[] = array(4, 1, 1, 2, 1, 2); //86 : [v] |
|
| 111 | + $this->t128[] = array(4, 2, 1, 1, 1, 2); //87 : [w] |
|
| 112 | + $this->t128[] = array(4, 2, 1, 2, 1, 1); //88 : [x] |
|
| 113 | + $this->t128[] = array(2, 1, 2, 1, 4, 1); //89 : [y] |
|
| 114 | + $this->t128[] = array(2, 1, 4, 1, 2, 1); //90 : [z] |
|
| 115 | + $this->t128[] = array(4, 1, 2, 1, 2, 1); //91 : [{] |
|
| 116 | + $this->t128[] = array(1, 1, 1, 1, 4, 3); //92 : [|] |
|
| 117 | + $this->t128[] = array(1, 1, 1, 3, 4, 1); //93 : [}] |
|
| 118 | + $this->t128[] = array(1, 3, 1, 1, 4, 1); //94 : [~] |
|
| 119 | + $this->t128[] = array(1, 1, 4, 1, 1, 3); //95 : [DEL] |
|
| 120 | + $this->t128[] = array(1, 1, 4, 3, 1, 1); //96 : [FNC3] |
|
| 121 | + $this->t128[] = array(4, 1, 1, 1, 1, 3); //97 : [FNC2] |
|
| 122 | + $this->t128[] = array(4, 1, 1, 3, 1, 1); //98 : [SHIFT] |
|
| 123 | + $this->t128[] = array(1, 1, 3, 1, 4, 1); //99 : [Cswap] |
|
| 124 | + $this->t128[] = array(1, 1, 4, 1, 3, 1); //100 : [Bswap] |
|
| 125 | + $this->t128[] = array(3, 1, 1, 1, 4, 1); //101 : [Aswap] |
|
| 126 | + $this->t128[] = array(4, 1, 1, 1, 3, 1); //102 : [FNC1] |
|
| 127 | + $this->t128[] = array(2, 1, 1, 4, 1, 2); //103 : [Astart] |
|
| 128 | + $this->t128[] = array(2, 1, 1, 2, 1, 4); //104 : [Bstart] |
|
| 129 | + $this->t128[] = array(2, 1, 1, 2, 3, 2); //105 : [Cstart] |
|
| 130 | + $this->t128[] = array(2, 3, 3, 1, 1, 1); //106 : [STOP] |
|
| 131 | + $this->t128[] = array(2, 1); //107 : [END BAR] |
|
| 132 | 132 | for ($i = 32; $i <= 95; $i++) { // conjunto de caracteres |
| 133 | 133 | $this->abcSet .= chr($i); |
| 134 | 134 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->abcSet .= chr($i); |
| 143 | 143 | $this->bSet .= chr($i); |
| 144 | 144 | } |
| 145 | - $this->cSet="0123456789"; |
|
| 145 | + $this->cSet = "0123456789"; |
|
| 146 | 146 | for ($i = 0; $i < 96; $i++) { |
| 147 | 147 | // convertendo grupos A & B |
| 148 | 148 | if (isset($this->setFrom["A"])) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $this->setFrom["B"] .= chr($i + 32); |
| 153 | 153 | } |
| 154 | 154 | if (isset($this->setTo["A"])) { |
| 155 | - $this->setTo["A"] .= chr(($i < 32) ? $i+64 : $i-32); |
|
| 155 | + $this->setTo["A"] .= chr(($i < 32) ? $i + 64 : $i - 32); |
|
| 156 | 156 | } |
| 157 | 157 | if (isset($this->setTo["A"])) { |
| 158 | 158 | $this->setTo["B"] .= chr($i); |
@@ -165,21 +165,21 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function code128($x, $y, $code, $w, $h) |
| 167 | 167 | { |
| 168 | - $Aguid=""; |
|
| 169 | - $Bguid=""; |
|
| 170 | - $Cguid=""; |
|
| 171 | - for ($i=0; $i < strlen($code); $i++) { |
|
| 172 | - $needle=substr($code, $i, 1); |
|
| 173 | - $Aguid .= ((strpos($this->aSet, $needle)===false) ? "N" : "O"); |
|
| 174 | - $Bguid .= ((strpos($this->bSet, $needle)===false) ? "N" : "O"); |
|
| 175 | - $Cguid .= ((strpos($this->cSet, $needle)===false) ? "N" : "O"); |
|
| 168 | + $Aguid = ""; |
|
| 169 | + $Bguid = ""; |
|
| 170 | + $Cguid = ""; |
|
| 171 | + for ($i = 0; $i < strlen($code); $i++) { |
|
| 172 | + $needle = substr($code, $i, 1); |
|
| 173 | + $Aguid .= ((strpos($this->aSet, $needle) === false) ? "N" : "O"); |
|
| 174 | + $Bguid .= ((strpos($this->bSet, $needle) === false) ? "N" : "O"); |
|
| 175 | + $Cguid .= ((strpos($this->cSet, $needle) === false) ? "N" : "O"); |
|
| 176 | 176 | } |
| 177 | 177 | $SminiC = "OOOO"; |
| 178 | 178 | $IminiC = 4; |
| 179 | 179 | $crypt = ""; |
| 180 | 180 | while ($code > "") { |
| 181 | 181 | $i = strpos($Cguid, $SminiC); |
| 182 | - if ($i!==false) { |
|
| 182 | + if ($i !== false) { |
|
| 183 | 183 | $Aguid [$i] = "N"; |
| 184 | 184 | $Bguid [$i] = "N"; |
| 185 | 185 | } |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | if ($made === false) { |
| 190 | 190 | $made = strlen($Cguid); |
| 191 | 191 | } |
| 192 | - if (fmod($made, 2)==1) { |
|
| 192 | + if (fmod($made, 2) == 1) { |
|
| 193 | 193 | $made--; |
| 194 | 194 | } |
| 195 | - for ($i=0; $i < $made; $i += 2) { |
|
| 195 | + for ($i = 0; $i < $made; $i += 2) { |
|
| 196 | 196 | $crypt .= chr(strval(substr($code, $i, 2))); |
| 197 | 197 | } |
| 198 | 198 | $jeu = "C"; |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | if ($madeB === false) { |
| 206 | 206 | $madeB = strlen($Bguid); |
| 207 | 207 | } |
| 208 | - $made = (($madeA < $madeB) ? $madeB : $madeA ); |
|
| 209 | - $jeu = (($madeA < $madeB) ? "B" : "A" ); |
|
| 208 | + $made = (($madeA < $madeB) ? $madeB : $madeA); |
|
| 209 | + $jeu = (($madeA < $madeB) ? "B" : "A"); |
|
| 210 | 210 | $jeuguid = $jeu . "guid"; |
| 211 | 211 | $crypt .= chr(($crypt > "") ? $this->jSwap["$jeu"] : $this->jStart["$jeu"]); |
| 212 | 212 | $crypt .= strtr(substr($code, 0, $made), $this->setFrom[$jeu], $this->setTo[$jeu]); |
@@ -217,18 +217,18 @@ discard block |
||
| 217 | 217 | $Cguid = substr($Cguid, $made); |
| 218 | 218 | } |
| 219 | 219 | $check = ord($crypt[0]); |
| 220 | - for ($i=0; $i<strlen($crypt); $i++) { |
|
| 220 | + for ($i = 0; $i < strlen($crypt); $i++) { |
|
| 221 | 221 | $check += (ord($crypt[$i]) * $i); |
| 222 | 222 | } |
| 223 | 223 | $check %= 103; |
| 224 | 224 | $crypt .= chr($check) . chr(106) . chr(107); |
| 225 | 225 | $i = (strlen($crypt) * 11) - 8; |
| 226 | - $modul = $w/$i; |
|
| 227 | - for ($i=0; $i<strlen($crypt); $i++) { |
|
| 226 | + $modul = $w / $i; |
|
| 227 | + for ($i = 0; $i < strlen($crypt); $i++) { |
|
| 228 | 228 | $c = $this->t128[ord($crypt[$i])]; |
| 229 | - for ($j=0; $j<count($c); $j++) { |
|
| 230 | - $this->Rect($x, $y, $c[$j]*$modul, $h, "F"); |
|
| 231 | - $x += ($c[$j++]+$c[$j])*$modul; |
|
| 229 | + for ($j = 0; $j < count($c); $j++) { |
|
| 230 | + $this->Rect($x, $y, $c[$j] * $modul, $h, "F"); |
|
| 231 | + $x += ($c[$j++] + $c[$j]) * $modul; |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | $this->angle = $angle; |
| 254 | 254 | if ($angle != 0) { |
| 255 | - $angle *= M_PI/180; |
|
| 255 | + $angle *= M_PI / 180; |
|
| 256 | 256 | $c = cos($angle); |
| 257 | 257 | $s = sin($angle); |
| 258 | - $cx =$x*$this->k; |
|
| 259 | - $cy = ($this->h-$y)*$this->k; |
|
| 258 | + $cx = $x * $this->k; |
|
| 259 | + $cy = ($this->h - $y) * $this->k; |
|
| 260 | 260 | $this->out( |
| 261 | 261 | sprintf( |
| 262 | 262 | 'q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm', |
@@ -294,40 +294,40 @@ discard block |
||
| 294 | 294 | } else { |
| 295 | 295 | $op = 'S'; |
| 296 | 296 | } |
| 297 | - $MyArc = 4/3 * (sqrt(2) - 1); |
|
| 298 | - $this->out(sprintf('%.2F %.2F m', ($x+$r)*$k, ($hp-$y)*$k)); |
|
| 299 | - $xc = $x+$w-$r; |
|
| 300 | - $yc = $y+$r; |
|
| 301 | - $this->out(sprintf('%.2F %.2F l', $xc*$k, ($hp-$y)*$k)); |
|
| 302 | - if (strpos($corners, '2')===false) { |
|
| 303 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-$y)*$k)); |
|
| 297 | + $MyArc = 4 / 3 * (sqrt(2) - 1); |
|
| 298 | + $this->out(sprintf('%.2F %.2F m', ($x + $r) * $k, ($hp - $y) * $k)); |
|
| 299 | + $xc = $x + $w - $r; |
|
| 300 | + $yc = $y + $r; |
|
| 301 | + $this->out(sprintf('%.2F %.2F l', $xc * $k, ($hp - $y) * $k)); |
|
| 302 | + if (strpos($corners, '2') === false) { |
|
| 303 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - $y) * $k)); |
|
| 304 | 304 | } else { |
| 305 | - $this->arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc); |
|
| 305 | + $this->arc($xc + $r * $MyArc, $yc - $r, $xc + $r, $yc - $r * $MyArc, $xc + $r, $yc); |
|
| 306 | 306 | } |
| 307 | - $xc = $x+$w-$r; |
|
| 308 | - $yc = $y+$h-$r; |
|
| 309 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-$yc)*$k)); |
|
| 310 | - if (strpos($corners, '3')===false) { |
|
| 311 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-($y+$h))*$k)); |
|
| 307 | + $xc = $x + $w - $r; |
|
| 308 | + $yc = $y + $h - $r; |
|
| 309 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - $yc) * $k)); |
|
| 310 | + if (strpos($corners, '3') === false) { |
|
| 311 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - ($y + $h)) * $k)); |
|
| 312 | 312 | } else { |
| 313 | - $this->arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r); |
|
| 313 | + $this->arc($xc + $r, $yc + $r * $MyArc, $xc + $r * $MyArc, $yc + $r, $xc, $yc + $r); |
|
| 314 | 314 | } |
| 315 | - $xc = $x+$r; |
|
| 316 | - $yc = $y+$h-$r; |
|
| 317 | - $this->out(sprintf('%.2F %.2F l', $xc*$k, ($hp-($y+$h))*$k)); |
|
| 318 | - if (strpos($corners, '4')===false) { |
|
| 319 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-($y+$h))*$k)); |
|
| 315 | + $xc = $x + $r; |
|
| 316 | + $yc = $y + $h - $r; |
|
| 317 | + $this->out(sprintf('%.2F %.2F l', $xc * $k, ($hp - ($y + $h)) * $k)); |
|
| 318 | + if (strpos($corners, '4') === false) { |
|
| 319 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - ($y + $h)) * $k)); |
|
| 320 | 320 | } else { |
| 321 | - $this->arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc); |
|
| 321 | + $this->arc($xc - $r * $MyArc, $yc + $r, $xc - $r, $yc + $r * $MyArc, $xc - $r, $yc); |
|
| 322 | 322 | } |
| 323 | - $xc = $x+$r ; |
|
| 324 | - $yc = $y+$r; |
|
| 325 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-$yc)*$k)); |
|
| 326 | - if (strpos($corners, '1')===false) { |
|
| 327 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-$y)*$k)); |
|
| 328 | - $this->out(sprintf('%.2F %.2F l', ($x+$r)*$k, ($hp-$y)*$k)); |
|
| 323 | + $xc = $x + $r; |
|
| 324 | + $yc = $y + $r; |
|
| 325 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - $yc) * $k)); |
|
| 326 | + if (strpos($corners, '1') === false) { |
|
| 327 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - $y) * $k)); |
|
| 328 | + $this->out(sprintf('%.2F %.2F l', ($x + $r) * $k, ($hp - $y) * $k)); |
|
| 329 | 329 | } else { |
| 330 | - $this->arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r); |
|
| 330 | + $this->arc($xc - $r, $yc - $r * $MyArc, $xc - $r * $MyArc, $yc - $r, $xc, $yc - $r); |
|
| 331 | 331 | } |
| 332 | 332 | $this->out($op); |
| 333 | 333 | } |
@@ -347,12 +347,12 @@ discard block |
||
| 347 | 347 | $this->out( |
| 348 | 348 | sprintf( |
| 349 | 349 | '%.2F %.2F %.2F %.2F %.2F %.2F c ', |
| 350 | - $x1*$this->k, |
|
| 351 | - ($h-$y1)*$this->k, |
|
| 352 | - $x2*$this->k, |
|
| 353 | - ($h-$y2)*$this->k, |
|
| 354 | - $x3*$this->k, |
|
| 355 | - ($h-$y3)*$this->k |
|
| 350 | + $x1 * $this->k, |
|
| 351 | + ($h - $y1) * $this->k, |
|
| 352 | + $x2 * $this->k, |
|
| 353 | + ($h - $y2) * $this->k, |
|
| 354 | + $x3 * $this->k, |
|
| 355 | + ($h - $y3) * $this->k |
|
| 356 | 356 | ) |
| 357 | 357 | ); |
| 358 | 358 | } |
@@ -369,26 +369,26 @@ discard block |
||
| 369 | 369 | public function dashedRect($x1, $y1, $x2, $y2, $width = 1, $nb = 15) |
| 370 | 370 | { |
| 371 | 371 | $this->setLineWidth($width); |
| 372 | - $longueur = abs($x1-$x2); |
|
| 373 | - $hauteur = abs($y1-$y2); |
|
| 372 | + $longueur = abs($x1 - $x2); |
|
| 373 | + $hauteur = abs($y1 - $y2); |
|
| 374 | 374 | if ($longueur > $hauteur) { |
| 375 | - $Pointilles = ($longueur/$nb)/2; |
|
| 375 | + $Pointilles = ($longueur / $nb) / 2; |
|
| 376 | 376 | } else { |
| 377 | - $Pointilles = ($hauteur/$nb)/2; |
|
| 377 | + $Pointilles = ($hauteur / $nb) / 2; |
|
| 378 | 378 | } |
| 379 | - for ($i=$x1; $i<=$x2; $i+=$Pointilles+$Pointilles) { |
|
| 380 | - for ($j=$i; $j<=($i+$Pointilles); $j++) { |
|
| 381 | - if ($j<=($x2-1)) { |
|
| 382 | - $this->line($j, $y1, $j+1, $y1); |
|
| 383 | - $this->line($j, $y2, $j+1, $y2); |
|
| 379 | + for ($i = $x1; $i <= $x2; $i += $Pointilles + $Pointilles) { |
|
| 380 | + for ($j = $i; $j <= ($i + $Pointilles); $j++) { |
|
| 381 | + if ($j <= ($x2 - 1)) { |
|
| 382 | + $this->line($j, $y1, $j + 1, $y1); |
|
| 383 | + $this->line($j, $y2, $j + 1, $y2); |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | - for ($i=$y1; $i<=$y2; $i+=$Pointilles+$Pointilles) { |
|
| 388 | - for ($j=$i; $j<=($i+$Pointilles); $j++) { |
|
| 389 | - if ($j<=($y2-1)) { |
|
| 390 | - $this->line($x1, $j, $x1, $j+1); |
|
| 391 | - $this->line($x2, $j, $x2, $j+1); |
|
| 387 | + for ($i = $y1; $i <= $y2; $i += $Pointilles + $Pointilles) { |
|
| 388 | + for ($j = $i; $j <= ($i + $Pointilles); $j++) { |
|
| 389 | + if ($j <= ($y2 - 1)) { |
|
| 390 | + $this->line($x1, $j, $x1, $j + 1); |
|
| 391 | + $this->line($x2, $j, $x2, $j + 1); |
|
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | } |
@@ -409,16 +409,16 @@ discard block |
||
| 409 | 409 | $yi = $this->getY(); |
| 410 | 410 | $hrow = $this->fontSize; |
| 411 | 411 | $textrows = $this->drawRows($w, $hrow, $strText, 0, $align, 0, 0, 0); |
| 412 | - $maxrows = floor($h/$this->fontSize); |
|
| 412 | + $maxrows = floor($h / $this->fontSize); |
|
| 413 | 413 | $rows = min($textrows, $maxrows); |
| 414 | 414 | $dy = 0; |
| 415 | 415 | if (strtoupper($valign) == 'M') { |
| 416 | - $dy = ($h-$rows*$this->fontSize)/2; |
|
| 416 | + $dy = ($h - $rows * $this->fontSize) / 2; |
|
| 417 | 417 | } |
| 418 | 418 | if (strtoupper($valign) == 'B') { |
| 419 | - $dy = $h-$rows*$this->fontSize; |
|
| 419 | + $dy = $h - $rows * $this->fontSize; |
|
| 420 | 420 | } |
| 421 | - $this->setY($yi+$dy); |
|
| 421 | + $this->setY($yi + $dy); |
|
| 422 | 422 | $this->setX($xi); |
| 423 | 423 | $this->drawRows($w, $hrow, $strText, 0, $align, false, $rows, 1); |
| 424 | 424 | if ($border) { |
@@ -440,17 +440,17 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | private function drawRows($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $maxline = 0, $prn = 0) |
| 442 | 442 | { |
| 443 | - $cw =& $this->currentFont['cw']; |
|
| 443 | + $cw = & $this->currentFont['cw']; |
|
| 444 | 444 | if ($w == 0) { |
| 445 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 445 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 446 | 446 | } |
| 447 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 447 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 448 | 448 | $s = str_replace("\r", '', $txt); |
| 449 | 449 | $nb = strlen($s); |
| 450 | - if ($nb > 0 && $s[$nb-1] == "\n") { |
|
| 450 | + if ($nb > 0 && $s[$nb - 1] == "\n") { |
|
| 451 | 451 | $nb--; |
| 452 | 452 | } |
| 453 | - $b=0; |
|
| 453 | + $b = 0; |
|
| 454 | 454 | if ($border) { |
| 455 | 455 | if ($border == 1) { |
| 456 | 456 | $border = 'LTRB'; |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | if (is_int(strpos($border, 'R'))) { |
| 465 | 465 | $b2 .= 'R'; |
| 466 | 466 | } |
| 467 | - $b = is_int(strpos($border, 'T')) ? $b2.'T' : $b2; |
|
| 467 | + $b = is_int(strpos($border, 'T')) ? $b2 . 'T' : $b2; |
|
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | $sep = -1; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | if ($prn == 1) { |
| 486 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 486 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 487 | 487 | } |
| 488 | 488 | $i++; |
| 489 | 489 | $sep = -1; |
@@ -517,19 +517,19 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | if ($prn == 1) { |
| 520 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 520 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 521 | 521 | } |
| 522 | 522 | } else { |
| 523 | 523 | if ($align == 'J') { |
| 524 | - $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; |
|
| 524 | + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->FontSize / ($ns - 1) : 0; |
|
| 525 | 525 | if ($prn == 1) { |
| 526 | - $this->out(sprintf('%.3F Tw', $this->ws*$this->k)); |
|
| 526 | + $this->out(sprintf('%.3F Tw', $this->ws * $this->k)); |
|
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | if ($prn == 1) { |
| 530 | - $this->cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill); |
|
| 530 | + $this->cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); |
|
| 531 | 531 | } |
| 532 | - $i = $sep+1; |
|
| 532 | + $i = $sep + 1; |
|
| 533 | 533 | } |
| 534 | 534 | $sep = -1; |
| 535 | 535 | $j = $i; |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | $b .= 'B'; |
| 557 | 557 | } |
| 558 | 558 | if ($prn == 1) { |
| 559 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 559 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 560 | 560 | } |
| 561 | 561 | $this->x = $this->lMargin; |
| 562 | 562 | return $nl; |
@@ -585,14 +585,14 @@ discard block |
||
| 585 | 585 | $wordwidth = $this->getStringWidth($word); |
| 586 | 586 | if ($wordwidth > $maxwidth) { |
| 587 | 587 | // Word is too long, we cut it |
| 588 | - for ($i=0; $i < strlen($word); $i++) { |
|
| 588 | + for ($i = 0; $i < strlen($word); $i++) { |
|
| 589 | 589 | $wordwidth = $this->getStringWidth(substr($word, $i, 1)); |
| 590 | 590 | if ($width + $wordwidth <= $maxwidth) { |
| 591 | 591 | $width += $wordwidth; |
| 592 | 592 | $text .= substr($word, $i, 1); |
| 593 | 593 | } else { |
| 594 | 594 | $width = $wordwidth; |
| 595 | - $text = rtrim($text)."\n".substr($word, $i, 1); |
|
| 595 | + $text = rtrim($text) . "\n" . substr($word, $i, 1); |
|
| 596 | 596 | $count++; |
| 597 | 597 | } |
| 598 | 598 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $count++; |
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | - $text = rtrim($text)."\n"; |
|
| 608 | + $text = rtrim($text) . "\n"; |
|
| 609 | 609 | $count++; |
| 610 | 610 | } |
| 611 | 611 | $text = rtrim($text); |
@@ -637,21 +637,21 @@ discard block |
||
| 637 | 637 | $scale = false, |
| 638 | 638 | $force = true |
| 639 | 639 | ) { |
| 640 | - $str_width=$this->getStringWidth($txt); |
|
| 640 | + $str_width = $this->getStringWidth($txt); |
|
| 641 | 641 | if ($w == 0) { |
| 642 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 642 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 643 | 643 | } |
| 644 | - $ratio = ($w-$this->cMargin*2)/$str_width; |
|
| 644 | + $ratio = ($w - $this->cMargin * 2) / $str_width; |
|
| 645 | 645 | $fit = ($ratio < 1 || ($ratio > 1 && $force)); |
| 646 | 646 | if ($fit) { |
| 647 | 647 | if ($scale) { |
| 648 | 648 | //Calcula a escala horizontal |
| 649 | - $horiz_scale = $ratio*100.0; |
|
| 649 | + $horiz_scale = $ratio * 100.0; |
|
| 650 | 650 | //Ajusta a escala horizontal |
| 651 | 651 | $this->out(sprintf('BT %.2F Tz ET', $horiz_scale)); |
| 652 | 652 | } else { |
| 653 | 653 | //Calcula o espaçamento de caracteres em pontos |
| 654 | - $char_space = ($w-$this->cMargin*2-$str_width)/max($this->_MBGetStringLength($txt)-1, 1)*$this->k; |
|
| 654 | + $char_space = ($w - $this->cMargin * 2 - $str_width) / max($this->_MBGetStringLength($txt) - 1, 1) * $this->k; |
|
| 655 | 655 | //Ajusta o espaçamento de caracteres |
| 656 | 656 | $this->out(sprintf('BT %.2F Tc ET', $char_space)); |
| 657 | 657 | } |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | $this->cell($w, $h, $txt, $border, $ln, $align, $fill, $link); |
| 663 | 663 | //Reseta o espaçamento de caracteres e a escala horizontal |
| 664 | 664 | if ($fit) { |
| 665 | - $this->out('BT '.($scale ? '100 Tz' : '0 Tc').' ET'); |
|
| 665 | + $this->out('BT ' . ($scale ? '100 Tz' : '0 Tc') . ' ET'); |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | $len = 0; |
| 758 | 758 | $nbbytes = strlen($s); |
| 759 | 759 | for ($i = 0; $i < $nbbytes; $i++) { |
| 760 | - if (ord($s[$i])<128) { |
|
| 760 | + if (ord($s[$i]) < 128) { |
|
| 761 | 761 | $len++; |
| 762 | 762 | } else { |
| 763 | 763 | $len++; |
@@ -783,11 +783,11 @@ discard block |
||
| 783 | 783 | { |
| 784 | 784 | $this->setDrawColor(110); |
| 785 | 785 | $this->setLineWidth($h); |
| 786 | - $wDash = ($w/$n)/2; |
|
| 787 | - for ($i=$x; $i<=$x+$w; $i += $wDash+$wDash) { |
|
| 788 | - for ($j=$i; $j<= ($i+$wDash); $j++) { |
|
| 789 | - if ($j <= ($x+$w-1)) { |
|
| 790 | - $this->line($j, $y, $j+1, $y); |
|
| 786 | + $wDash = ($w / $n) / 2; |
|
| 787 | + for ($i = $x; $i <= $x + $w; $i += $wDash + $wDash) { |
|
| 788 | + for ($j = $i; $j <= ($i + $wDash); $j++) { |
|
| 789 | + if ($j <= ($x + $w - 1)) { |
|
| 790 | + $this->line($j, $y, $j + 1, $y); |
|
| 791 | 791 | } |
| 792 | 792 | } |
| 793 | 793 | } |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | $y = $aux; |
| 813 | 813 | } |
| 814 | 814 | while ($y < $yfinal && $n > 0) { |
| 815 | - $this->line($x, $y, $x, $y+1); |
|
| 815 | + $this->line($x, $y, $x, $y + 1); |
|
| 816 | 816 | $y += 3; |
| 817 | 817 | $n--; |
| 818 | 818 | } |