@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
98 | 98 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
99 | 99 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
100 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
100 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
101 | 101 | * @param string $preVisualizar 0-Não 1-Sim |
102 | 102 | */ |
103 | 103 | public function __construct( |
@@ -491,8 +491,8 @@ discard block |
||
491 | 491 | * zCabecalho |
492 | 492 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
493 | 493 | * |
494 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
495 | - * @param number $y Posição vertical inicial, canto superior |
|
494 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
495 | + * @param integer $y Posição vertical inicial, canto superior |
|
496 | 496 | * @param number $pag Número da Página |
497 | 497 | * @param number $totPag Total de páginas |
498 | 498 | * @return number Posição vertical final |
@@ -1091,8 +1091,7 @@ discard block |
||
1091 | 1091 | * rodapeDACTE |
1092 | 1092 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
1093 | 1093 | * |
1094 | - * @param number $xInic Posição horizontal canto esquerdo |
|
1095 | - * @param number $yFinal Posição vertical final para impressão |
|
1094 | + * @param integer $x |
|
1096 | 1095 | */ |
1097 | 1096 | protected function zRodape($x, $y) |
1098 | 1097 | { |
@@ -1115,8 +1114,8 @@ discard block |
||
1115 | 1114 | * zTomador |
1116 | 1115 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1117 | 1116 | * |
1118 | - * @param number $x Posição horizontal canto esquerdo |
|
1119 | - * @param number $y Posição vertical canto superior |
|
1117 | + * @param integer $x Posição horizontal canto esquerdo |
|
1118 | + * @param integer $y Posição vertical canto superior |
|
1120 | 1119 | * @return number Posição vertical final |
1121 | 1120 | */ |
1122 | 1121 | protected function zTomador($x = 0, $y = 0) |
@@ -1204,8 +1203,8 @@ discard block |
||
1204 | 1203 | * zCompValorServ |
1205 | 1204 | * Monta o campo com os componentes da prestação de serviços. |
1206 | 1205 | * |
1207 | - * @param number $x Posição horizontal canto esquerdo |
|
1208 | - * @param number $y Posição vertical canto superior |
|
1206 | + * @param integer $x Posição horizontal canto esquerdo |
|
1207 | + * @param integer $y Posição vertical canto superior |
|
1209 | 1208 | * @return number Posição vertical final |
1210 | 1209 | */ |
1211 | 1210 | protected function zCompValorServ($x = 0, $y = 0) |
@@ -1304,8 +1303,8 @@ discard block |
||
1304 | 1303 | * zImpostos |
1305 | 1304 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1306 | 1305 | * |
1307 | - * @param number $x Posição horizontal canto esquerdo |
|
1308 | - * @param number $y Posição vertical canto superior |
|
1306 | + * @param integer $x Posição horizontal canto esquerdo |
|
1307 | + * @param integer $y Posição vertical canto superior |
|
1309 | 1308 | * @return number Posição vertical final |
1310 | 1309 | */ |
1311 | 1310 | protected function zImpostos($x = 0, $y = 0) |
@@ -1467,8 +1466,8 @@ discard block |
||
1467 | 1466 | * zInfPrestacaoServico |
1468 | 1467 | * Monta o campo com das informações da prestação do serviço |
1469 | 1468 | * |
1470 | - * @param number $x Posição horizontal canto esquerdo |
|
1471 | - * @param number $y Posição vertical canto superior |
|
1469 | + * @param integer $x Posição horizontal canto esquerdo |
|
1470 | + * @param integer $y Posição vertical canto superior |
|
1472 | 1471 | * @return number Posição vertical final |
1473 | 1472 | */ |
1474 | 1473 | protected function zInfPrestacaoServico($x = 0, $y = 0) |
@@ -1548,8 +1547,8 @@ discard block |
||
1548 | 1547 | * zDocCompl |
1549 | 1548 | * Monta o campo com os dados do remetente na DACTE. |
1550 | 1549 | * |
1551 | - * @param number $x Posição horizontal canto esquerdo |
|
1552 | - * @param number $y Posição vertical canto superior |
|
1550 | + * @param integer $x Posição horizontal canto esquerdo |
|
1551 | + * @param integer $y Posição vertical canto superior |
|
1553 | 1552 | * @return number Posição vertical final |
1554 | 1553 | */ |
1555 | 1554 | protected function zDocCompl($x = 0, $y = 0) |
@@ -1611,8 +1610,8 @@ discard block |
||
1611 | 1610 | * zObs |
1612 | 1611 | * Monta o campo com os dados do remetente na DACTE. |
1613 | 1612 | * |
1614 | - * @param number $x Posição horizontal canto esquerdo |
|
1615 | - * @param number $y Posição vertical canto superior |
|
1613 | + * @param integer $x Posição horizontal canto esquerdo |
|
1614 | + * @param integer $y Posição vertical canto superior |
|
1616 | 1615 | * @return number Posição vertical final |
1617 | 1616 | */ |
1618 | 1617 | protected function zObs($x = 0, $y = 0) |
@@ -1654,8 +1653,8 @@ discard block |
||
1654 | 1653 | * zSeguro |
1655 | 1654 | * Monta o campo com os dados de seguro do CT-e OS. |
1656 | 1655 | * |
1657 | - * @param number $x Posição horizontal canto esquerdo |
|
1658 | - * @param number $y Posição vertical canto superior |
|
1656 | + * @param integer $x Posição horizontal canto esquerdo |
|
1657 | + * @param integer $y Posição vertical canto superior |
|
1659 | 1658 | * @return number Posição vertical final |
1660 | 1659 | */ |
1661 | 1660 | protected function zSeguro($x = 0, $y = 0) |
@@ -1715,8 +1714,8 @@ discard block |
||
1715 | 1714 | * zModalRod |
1716 | 1715 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1717 | 1716 | * |
1718 | - * @param number $x Posição horizontal canto esquerdo |
|
1719 | - * @param number $y Posição vertical canto superior |
|
1717 | + * @param integer $x Posição horizontal canto esquerdo |
|
1718 | + * @param integer $y Posição vertical canto superior |
|
1720 | 1719 | * @return number Posição vertical final |
1721 | 1720 | */ |
1722 | 1721 | protected function zModalRod($x = 0, $y = 0) |
@@ -1803,8 +1802,8 @@ discard block |
||
1803 | 1802 | * zModalAquaviario |
1804 | 1803 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1805 | 1804 | * |
1806 | - * @param number $x Posição horizontal canto esquerdo |
|
1807 | - * @param number $y Posição vertical canto superior |
|
1805 | + * @param integer $x Posição horizontal canto esquerdo |
|
1806 | + * @param integer $y Posição vertical canto superior |
|
1808 | 1807 | * @return number Posição vertical final |
1809 | 1808 | */ |
1810 | 1809 | protected function zModalAquaviario($x = 0, $y = 0) |
@@ -1973,8 +1972,8 @@ discard block |
||
1973 | 1972 | * zModalFerr |
1974 | 1973 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1975 | 1974 | * |
1976 | - * @param number $x Posição horizontal canto esquerdo |
|
1977 | - * @param number $y Posição vertical canto superior |
|
1975 | + * @param integer $x Posição horizontal canto esquerdo |
|
1976 | + * @param integer $y Posição vertical canto superior |
|
1978 | 1977 | * @return number Posição vertical final |
1979 | 1978 | */ |
1980 | 1979 | protected function zModalFerr($x = 0, $y = 0) |
@@ -2251,8 +2250,8 @@ discard block |
||
2251 | 2250 | * zCanhoto |
2252 | 2251 | * Monta o campo com os dados do remetente na DACTE. |
2253 | 2252 | * |
2254 | - * @param number $x Posição horizontal canto esquerdo |
|
2255 | - * @param number $y Posição vertical canto superior |
|
2253 | + * @param integer $x Posição horizontal canto esquerdo |
|
2254 | + * @param integer $y Posição vertical canto superior |
|
2256 | 2255 | * @return number Posição vertical final |
2257 | 2256 | */ |
2258 | 2257 | protected function zCanhoto($x = 0, $y = 0) |
@@ -2336,9 +2335,10 @@ discard block |
||
2336 | 2335 | * zDadosAdic |
2337 | 2336 | * Coloca o grupo de dados adicionais da DACTE. |
2338 | 2337 | * |
2339 | - * @param number $x Posição horizontal canto esquerdo |
|
2340 | - * @param number $y Posição vertical canto superior |
|
2341 | - * @param number $h altura do campo |
|
2338 | + * @param integer $x Posição horizontal canto esquerdo |
|
2339 | + * @param double $y Posição vertical canto superior |
|
2340 | + * @param integer $h altura do campo |
|
2341 | + * @param integer $pag |
|
2342 | 2342 | * @return number Posição vertical final |
2343 | 2343 | */ |
2344 | 2344 | protected function zDadosAdic($x, $y, $pag, $h) |
@@ -2419,11 +2419,11 @@ discard block |
||
2419 | 2419 | * zhDashedLine |
2420 | 2420 | * Desenha uma linha horizontal tracejada com o FPDF |
2421 | 2421 | * |
2422 | - * @param number $x Posição horizontal inicial, em mm |
|
2423 | - * @param number $y Posição vertical inicial, em mm |
|
2422 | + * @param integer $x Posição horizontal inicial, em mm |
|
2423 | + * @param integer $y Posição vertical inicial, em mm |
|
2424 | 2424 | * @param number $w Comprimento da linha, em mm |
2425 | - * @param number $h Espessura da linha, em mm |
|
2426 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
2425 | + * @param double $h Espessura da linha, em mm |
|
2426 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
2427 | 2427 | * @return none |
2428 | 2428 | */ |
2429 | 2429 | protected function zhDashedLine($x, $y, $w, $h, $n) |
@@ -2582,7 +2582,7 @@ discard block |
||
2582 | 2582 | * Fornece a imformação multiplicação de peso contida na CTe |
2583 | 2583 | * |
2584 | 2584 | * @param interger $U Informação de peso extraida da CTe |
2585 | - * @return interger |
|
2585 | + * @return integer |
|
2586 | 2586 | */ |
2587 | 2587 | protected function zMultiUniPeso($U = '') |
2588 | 2588 | { |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $y += 19; |
376 | 376 | $x = $xInic; |
377 | 377 | $r = $this->zSeguro($x, $y); |
378 | - $y = $y-12; |
|
378 | + $y = $y - 12; |
|
379 | 379 | |
380 | 380 | |
381 | 381 | switch ($this->modal) { |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | 'font' => $this->fontePadrao, |
581 | 581 | 'size' => 7, |
582 | 582 | 'style' => ''); |
583 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
583 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
584 | 584 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
585 | 585 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
586 | 586 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | $this->pdf->SetTextColor(0, 0, 0); |
969 | 969 | } |
970 | 970 | //indicar sem valor |
971 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
971 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
972 | 972 | $x = 10; |
973 | 973 | if ($this->orientacao == 'P') { |
974 | 974 | $y = round($this->hPrint / 2, 0); |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
992 | 992 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
993 | 993 | $this->pdf->SetTextColor(0, 0, 0); |
994 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
994 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
995 | 995 | $h = 5; |
996 | 996 | $w = $maxW - (2 * 10); |
997 | 997 | $x = 55; |
@@ -1009,14 +1009,14 @@ discard block |
||
1009 | 1009 | 'size' => 41, |
1010 | 1010 | 'style' => 'B'); |
1011 | 1011 | $texto = "Sem Validade Jurídica"; |
1012 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1012 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1013 | 1013 | $this->pdf->SetTextColor(90, 90, 90); |
1014 | 1014 | $texto = "SEM VALOR FISCAL"; |
1015 | 1015 | $aFont = array( |
1016 | 1016 | 'font' => $this->fontePadrao, |
1017 | 1017 | 'size' => 48, |
1018 | 1018 | 'style' => 'B'); |
1019 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1019 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1020 | 1020 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
1021 | 1021 | } else { |
1022 | 1022 | $x = 10; |
@@ -1102,13 +1102,13 @@ discard block |
||
1102 | 1102 | 'font' => $this->fontePadrao, |
1103 | 1103 | 'size' => 6, |
1104 | 1104 | 'style' => ''); |
1105 | - $this->pTextBox($x-1, $y+2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1106 | - $texto = $this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
1105 | + $this->pTextBox($x - 1, $y + 2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1106 | + $texto = $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
1107 | 1107 | $aFont = array( |
1108 | 1108 | 'font' => $this->fontePadrao, |
1109 | 1109 | 'size' => 6, |
1110 | 1110 | 'style' => ''); |
1111 | - $this->pTextBox($x-50, $y+2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1111 | + $this->pTextBox($x - 50, $y + 2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1112 | 1112 | } //fim zRodape |
1113 | 1113 | |
1114 | 1114 | /** |
@@ -1195,7 +1195,7 @@ discard block |
||
1195 | 1195 | $texto = 'FONE'; |
1196 | 1196 | $aFont = $this->formatPadrao; |
1197 | 1197 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1198 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
1198 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
1199 | 1199 | $aFont = $this->formatNegrito; |
1200 | 1200 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1201 | 1201 | } //fim da função tomadorDACTE |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | $aFont = $this->formatPadrao; |
1336 | 1336 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1337 | 1337 | |
1338 | - $wCol02=0.18; |
|
1338 | + $wCol02 = 0.18; |
|
1339 | 1339 | $x += $w * $wCol02; |
1340 | 1340 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1341 | 1341 | $texto = 'ALÍQ ICMS'; |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | $x += $w * $wCol02; |
1412 | 1412 | |
1413 | 1413 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
1414 | - number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
1414 | + number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
1415 | 1415 | $aFont = $this->formatNegrito; |
1416 | 1416 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1417 | 1417 | |
@@ -1639,14 +1639,14 @@ discard block |
||
1639 | 1639 | $texto .= $xObs; |
1640 | 1640 | } |
1641 | 1641 | $textoObs = explode("Motorista:", $texto); |
1642 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
1642 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
1643 | 1643 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
1644 | 1644 | $aFont = array( |
1645 | 1645 | 'font' => $this->fontePadrao, |
1646 | 1646 | 'size' => 7.5, |
1647 | 1647 | 'style' => ''); |
1648 | 1648 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
1649 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
1649 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
1650 | 1650 | } //fim da função obsDACTE |
1651 | 1651 | |
1652 | 1652 | /** |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | $aFont = $this->formatPadrao; |
1685 | 1685 | $this->pTextBox($x, $y, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1686 | 1686 | |
1687 | - $wCol02=0.33; |
|
1687 | + $wCol02 = 0.33; |
|
1688 | 1688 | $x += $w * $wCol02; |
1689 | 1689 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1690 | 1690 | $texto = 'NÚMERO DA APÓLICE'; |
@@ -1744,7 +1744,7 @@ discard block |
||
1744 | 1744 | $aFont = $this->formatPadrao; |
1745 | 1745 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1746 | 1746 | |
1747 | - $wCol02=0.18; |
|
1747 | + $wCol02 = 0.18; |
|
1748 | 1748 | $x += $w * $wCol02; |
1749 | 1749 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1750 | 1750 | $texto = 'PLACA DO VEÍCULO'; |
@@ -1786,8 +1786,7 @@ discard block |
||
1786 | 1786 | $x += $w * $wCol02; |
1787 | 1787 | |
1788 | 1788 | $texto = !empty($this->getTagValue($this->veic->item(0), "CPF")) ? |
1789 | - $this->getTagValue($this->veic->item(0), "CPF") : |
|
1790 | - (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
1789 | + $this->getTagValue($this->veic->item(0), "CPF") : (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
1791 | 1790 | $this->getTagValue($this->veic->item(0), "CNPJ") : ''); |
1792 | 1791 | $aFont = $this->formatNegrito; |
1793 | 1792 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2256,7 +2255,7 @@ discard block |
||
2256 | 2255 | */ |
2257 | 2256 | protected function zCanhoto($x = 0, $y = 0) |
2258 | 2257 | { |
2259 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
2258 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
2260 | 2259 | $y = $y + 2; |
2261 | 2260 | $oldX = $x; |
2262 | 2261 | $oldY = $y; |
@@ -2295,7 +2294,7 @@ discard block |
||
2295 | 2294 | |
2296 | 2295 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
2297 | 2296 | |
2298 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
2297 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
2299 | 2298 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
2300 | 2299 | $aFont = array( |
2301 | 2300 | 'font' => $this->fontePadrao, |
@@ -2305,14 +2304,14 @@ discard block |
||
2305 | 2304 | $x = $oldX; |
2306 | 2305 | $y = $y + 5; |
2307 | 2306 | |
2308 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
2307 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
2309 | 2308 | |
2310 | 2309 | $texto = 'RG'; |
2311 | 2310 | $aFont = array( |
2312 | 2311 | 'font' => $this->fontePadrao, |
2313 | 2312 | 'size' => 6, |
2314 | 2313 | 'style' => ''); |
2315 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2314 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2316 | 2315 | $x += $w * 0.85; |
2317 | 2316 | |
2318 | 2317 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -30,7 +30,7 @@ |
||
30 | 30 | protected $xml; // string XML NFe |
31 | 31 | protected $logomarca = ''; // path para logomarca em jpg |
32 | 32 | protected $errMsg = ''; // mesagens de erro |
33 | - protected $errStatus = false;// status de erro TRUE um erro ocorreu false sem erros |
|
33 | + protected $errStatus = false; // status de erro TRUE um erro ocorreu false sem erros |
|
34 | 34 | protected $orientacao = 'P'; //orientação da DANFE P-Retrato ou L-Paisagem |
35 | 35 | protected $papel = 'A4'; //formato do papel |
36 | 36 | //destivo do arquivo pdf I-borwser, S-retorna o arquivo, D-força download, F-salva em arquivo local |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param string $sPathLogo Caminho para o arquivo do logo |
79 | 79 | * @param string $sDestino Estabelece a direção do envio do documento PDF I-browser D-browser com download S- |
80 | 80 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
81 | - * @param string $fonteDAMDFE Nome da fonte alternativa do DAnfe |
|
81 | + * @param string $fontePDF Nome da fonte alternativa do DAnfe |
|
82 | 82 | * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
83 | 83 | */ |
84 | 84 | public function __construct( |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * headerMDFePaisagem |
275 | 275 | * @param float $x |
276 | 276 | * @param float $y |
277 | - * @return string |
|
277 | + * @return double |
|
278 | 278 | */ |
279 | 279 | private function headerMDFePaisagem($x, $y) |
280 | 280 | { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * |
437 | 437 | * @param float $x |
438 | 438 | * @param float $y |
439 | - * @return string |
|
439 | + * @return double |
|
440 | 440 | */ |
441 | 441 | private function headerMDFeRetrato($x, $y) |
442 | 442 | { |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | * |
604 | 604 | * @param float $x |
605 | 605 | * @param float $y |
606 | - * @return void |
|
606 | + * @return double |
|
607 | 607 | */ |
608 | 608 | private function bodyMDFe($x, $y) |
609 | 609 | { |
@@ -16,7 +16,6 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | use Com\Tecnick\Barcode\Barcode; |
19 | -use DateTime; |
|
20 | 19 | use NFePHP\DA\Legacy\Dom; |
21 | 20 | use NFePHP\DA\Legacy\Common; |
22 | 21 | use NFePHP\DA\Legacy\Pdf; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
107 | 107 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
108 | 108 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
109 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
109 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
110 | 110 | * @param string $preVisualizar 0-Não 1-Sim |
111 | 111 | */ |
112 | 112 | public function __construct( |
@@ -568,8 +568,8 @@ discard block |
||
568 | 568 | * zCabecalho |
569 | 569 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
570 | 570 | * |
571 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
572 | - * @param number $y Posição vertical inicial, canto superior |
|
571 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
572 | + * @param integer $y Posição vertical inicial, canto superior |
|
573 | 573 | * @param number $pag Número da Página |
574 | 574 | * @param number $totPag Total de páginas |
575 | 575 | * @return number Posição vertical final |
@@ -1216,8 +1216,7 @@ discard block |
||
1216 | 1216 | * rodapeDACTE |
1217 | 1217 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
1218 | 1218 | * |
1219 | - * @param number $xInic Posição horizontal canto esquerdo |
|
1220 | - * @param number $yFinal Posição vertical final para impressão |
|
1219 | + * @param integer $x |
|
1221 | 1220 | */ |
1222 | 1221 | protected function zRodape($x, $y) |
1223 | 1222 | { |
@@ -1240,8 +1239,8 @@ discard block |
||
1240 | 1239 | * zRemetente |
1241 | 1240 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1242 | 1241 | * |
1243 | - * @param number $x Posição horizontal canto esquerdo |
|
1244 | - * @param number $y Posição vertical canto superior |
|
1242 | + * @param integer $x Posição horizontal canto esquerdo |
|
1243 | + * @param integer $y Posição vertical canto superior |
|
1245 | 1244 | * @return number Posição vertical final |
1246 | 1245 | */ |
1247 | 1246 | protected function zRemetente($x = 0, $y = 0) |
@@ -1328,8 +1327,8 @@ discard block |
||
1328 | 1327 | * zDestinatario |
1329 | 1328 | * Monta o campo com os dados do destinatário na DACTE. |
1330 | 1329 | * |
1331 | - * @param number $x Posição horizontal canto esquerdo |
|
1332 | - * @param number $y Posição vertical canto superior |
|
1330 | + * @param integer $x Posição horizontal canto esquerdo |
|
1331 | + * @param integer $y Posição vertical canto superior |
|
1333 | 1332 | * @return number Posição vertical final |
1334 | 1333 | */ |
1335 | 1334 | protected function zDestinatario($x = 0, $y = 0) |
@@ -1415,8 +1414,8 @@ discard block |
||
1415 | 1414 | * zExpedidor |
1416 | 1415 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1417 | 1416 | * |
1418 | - * @param number $x Posição horizontal canto esquerdo |
|
1419 | - * @param number $y Posição vertical canto superior |
|
1417 | + * @param integer $x Posição horizontal canto esquerdo |
|
1418 | + * @param integer $y Posição vertical canto superior |
|
1420 | 1419 | * @return number Posição vertical final |
1421 | 1420 | */ |
1422 | 1421 | protected function zExpedidor($x = 0, $y = 0) |
@@ -1512,8 +1511,8 @@ discard block |
||
1512 | 1511 | * zRecebedor |
1513 | 1512 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1514 | 1513 | * |
1515 | - * @param number $x Posição horizontal canto esquerdo |
|
1516 | - * @param number $y Posição vertical canto superior |
|
1514 | + * @param integer $x Posição horizontal canto esquerdo |
|
1515 | + * @param integer $y Posição vertical canto superior |
|
1517 | 1516 | * @return number Posição vertical final |
1518 | 1517 | */ |
1519 | 1518 | protected function zRecebedor($x = 0, $y = 0) |
@@ -1609,8 +1608,8 @@ discard block |
||
1609 | 1608 | * zTomador |
1610 | 1609 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1611 | 1610 | * |
1612 | - * @param number $x Posição horizontal canto esquerdo |
|
1613 | - * @param number $y Posição vertical canto superior |
|
1611 | + * @param integer $x Posição horizontal canto esquerdo |
|
1612 | + * @param integer $y Posição vertical canto superior |
|
1614 | 1613 | * @return number Posição vertical final |
1615 | 1614 | */ |
1616 | 1615 | protected function zTomador($x = 0, $y = 0) |
@@ -1698,8 +1697,8 @@ discard block |
||
1698 | 1697 | * zDescricaoCarga |
1699 | 1698 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1700 | 1699 | * |
1701 | - * @param number $x Posição horizontal canto esquerdo |
|
1702 | - * @param number $y Posição vertical canto superior |
|
1700 | + * @param integer $x Posição horizontal canto esquerdo |
|
1701 | + * @param integer $y Posição vertical canto superior |
|
1703 | 1702 | * @return number Posição vertical final |
1704 | 1703 | */ |
1705 | 1704 | protected function zDescricaoCarga($x = 0, $y = 0) |
@@ -1878,8 +1877,8 @@ discard block |
||
1878 | 1877 | * zCompValorServ |
1879 | 1878 | * Monta o campo com os componentes da prestação de serviços. |
1880 | 1879 | * |
1881 | - * @param number $x Posição horizontal canto esquerdo |
|
1882 | - * @param number $y Posição vertical canto superior |
|
1880 | + * @param integer $x Posição horizontal canto esquerdo |
|
1881 | + * @param integer $y Posição vertical canto superior |
|
1883 | 1882 | * @return number Posição vertical final |
1884 | 1883 | */ |
1885 | 1884 | protected function zCompValorServ($x = 0, $y = 0) |
@@ -1977,8 +1976,8 @@ discard block |
||
1977 | 1976 | * zImpostos |
1978 | 1977 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1979 | 1978 | * |
1980 | - * @param number $x Posição horizontal canto esquerdo |
|
1981 | - * @param number $y Posição vertical canto superior |
|
1979 | + * @param integer $x Posição horizontal canto esquerdo |
|
1980 | + * @param integer $y Posição vertical canto superior |
|
1982 | 1981 | * @return number Posição vertical final |
1983 | 1982 | */ |
1984 | 1983 | protected function zImpostos($x = 0, $y = 0) |
@@ -2155,8 +2154,8 @@ discard block |
||
2155 | 2154 | * zDocOrig |
2156 | 2155 | * Monta o campo com os documentos originarios. |
2157 | 2156 | * |
2158 | - * @param number $x Posição horizontal canto esquerdo |
|
2159 | - * @param number $y Posição vertical canto superior |
|
2157 | + * @param integer $x Posição horizontal canto esquerdo |
|
2158 | + * @param integer $y Posição vertical canto superior |
|
2160 | 2159 | * @return number Posição vertical final |
2161 | 2160 | */ |
2162 | 2161 | protected function zDocOrig($x = 0, $y = 0) |
@@ -2428,8 +2427,8 @@ discard block |
||
2428 | 2427 | * zDocOrigContinuacao |
2429 | 2428 | * Monta o campo com os documentos originarios. |
2430 | 2429 | * |
2431 | - * @param number $x Posição horizontal canto esquerdo |
|
2432 | - * @param number $y Posição vertical canto superior |
|
2430 | + * @param integer $x Posição horizontal canto esquerdo |
|
2431 | + * @param integer $y Posição vertical canto superior |
|
2433 | 2432 | * @return number Posição vertical final |
2434 | 2433 | */ |
2435 | 2434 | protected function zDocOrigContinuacao($x = 0, $y = 0) |
@@ -2558,8 +2557,8 @@ discard block |
||
2558 | 2557 | * zDocCompl |
2559 | 2558 | * Monta o campo com os dados do remetente na DACTE. |
2560 | 2559 | * |
2561 | - * @param number $x Posição horizontal canto esquerdo |
|
2562 | - * @param number $y Posição vertical canto superior |
|
2560 | + * @param integer $x Posição horizontal canto esquerdo |
|
2561 | + * @param integer $y Posição vertical canto superior |
|
2563 | 2562 | * @return number Posição vertical final |
2564 | 2563 | */ |
2565 | 2564 | protected function zDocCompl($x = 0, $y = 0) |
@@ -2629,8 +2628,8 @@ discard block |
||
2629 | 2628 | * zObs |
2630 | 2629 | * Monta o campo com os dados do remetente na DACTE. |
2631 | 2630 | * |
2632 | - * @param number $x Posição horizontal canto esquerdo |
|
2633 | - * @param number $y Posição vertical canto superior |
|
2631 | + * @param integer $x Posição horizontal canto esquerdo |
|
2632 | + * @param integer $y Posição vertical canto superior |
|
2634 | 2633 | * @return number Posição vertical final |
2635 | 2634 | */ |
2636 | 2635 | protected function zObs($x = 0, $y = 0) |
@@ -2672,8 +2671,8 @@ discard block |
||
2672 | 2671 | * zModalRod |
2673 | 2672 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2674 | 2673 | * |
2675 | - * @param number $x Posição horizontal canto esquerdo |
|
2676 | - * @param number $y Posição vertical canto superior |
|
2674 | + * @param integer $x Posição horizontal canto esquerdo |
|
2675 | + * @param integer $y Posição vertical canto superior |
|
2677 | 2676 | * @return number Posição vertical final |
2678 | 2677 | */ |
2679 | 2678 | protected function zModalRod($x = 0, $y = 0) |
@@ -2715,8 +2714,8 @@ discard block |
||
2715 | 2714 | * zModalAereo |
2716 | 2715 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2717 | 2716 | * |
2718 | - * @param number $x Posição horizontal canto esquerdo |
|
2719 | - * @param number $y Posição vertical canto superior |
|
2717 | + * @param integer $x Posição horizontal canto esquerdo |
|
2718 | + * @param integer $y Posição vertical canto superior |
|
2720 | 2719 | * @return number Posição vertical final |
2721 | 2720 | */ |
2722 | 2721 | protected function zModalAereo($x = 0, $y = 0) |
@@ -2778,8 +2777,8 @@ discard block |
||
2778 | 2777 | * zModalAquaviario |
2779 | 2778 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2780 | 2779 | * |
2781 | - * @param number $x Posição horizontal canto esquerdo |
|
2782 | - * @param number $y Posição vertical canto superior |
|
2780 | + * @param integer $x Posição horizontal canto esquerdo |
|
2781 | + * @param integer $y Posição vertical canto superior |
|
2783 | 2782 | * @return number Posição vertical final |
2784 | 2783 | */ |
2785 | 2784 | protected function zModalAquaviario($x = 0, $y = 0) |
@@ -2948,8 +2947,8 @@ discard block |
||
2948 | 2947 | * zModalFerr |
2949 | 2948 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2950 | 2949 | * |
2951 | - * @param number $x Posição horizontal canto esquerdo |
|
2952 | - * @param number $y Posição vertical canto superior |
|
2950 | + * @param integer $x Posição horizontal canto esquerdo |
|
2951 | + * @param integer $y Posição vertical canto superior |
|
2953 | 2952 | * @return number Posição vertical final |
2954 | 2953 | */ |
2955 | 2954 | protected function zModalFerr($x = 0, $y = 0) |
@@ -3226,8 +3225,8 @@ discard block |
||
3226 | 3225 | * zCanhoto |
3227 | 3226 | * Monta o campo com os dados do remetente na DACTE. |
3228 | 3227 | * |
3229 | - * @param number $x Posição horizontal canto esquerdo |
|
3230 | - * @param number $y Posição vertical canto superior |
|
3228 | + * @param integer $x Posição horizontal canto esquerdo |
|
3229 | + * @param integer $y Posição vertical canto superior |
|
3231 | 3230 | * @return number Posição vertical final |
3232 | 3231 | */ |
3233 | 3232 | protected function zCanhoto($x = 0, $y = 0) |
@@ -3311,9 +3310,10 @@ discard block |
||
3311 | 3310 | * zDadosAdic |
3312 | 3311 | * Coloca o grupo de dados adicionais da DACTE. |
3313 | 3312 | * |
3314 | - * @param number $x Posição horizontal canto esquerdo |
|
3313 | + * @param integer $x Posição horizontal canto esquerdo |
|
3315 | 3314 | * @param number $y Posição vertical canto superior |
3316 | - * @param number $h altura do campo |
|
3315 | + * @param integer $h altura do campo |
|
3316 | + * @param integer $pag |
|
3317 | 3317 | * @return number Posição vertical final |
3318 | 3318 | */ |
3319 | 3319 | protected function zDadosAdic($x, $y, $pag, $h) |
@@ -3394,11 +3394,11 @@ discard block |
||
3394 | 3394 | * zhDashedLine |
3395 | 3395 | * Desenha uma linha horizontal tracejada com o FPDF |
3396 | 3396 | * |
3397 | - * @param number $x Posição horizontal inicial, em mm |
|
3398 | - * @param number $y Posição vertical inicial, em mm |
|
3397 | + * @param integer $x Posição horizontal inicial, em mm |
|
3398 | + * @param integer $y Posição vertical inicial, em mm |
|
3399 | 3399 | * @param number $w Comprimento da linha, em mm |
3400 | - * @param number $h Espessura da linha, em mm |
|
3401 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
3400 | + * @param double $h Espessura da linha, em mm |
|
3401 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
3402 | 3402 | * @return none |
3403 | 3403 | */ |
3404 | 3404 | protected function zhDashedLine($x, $y, $w, $h, $n) |
@@ -3557,7 +3557,7 @@ discard block |
||
3557 | 3557 | * Fornece a imformação multiplicação de peso contida na CTe |
3558 | 3558 | * |
3559 | 3559 | * @param interger $U Informação de peso extraida da CTe |
3560 | - * @return interger |
|
3560 | + * @return integer |
|
3561 | 3561 | */ |
3562 | 3562 | protected function zMultiUniPeso($U = '') |
3563 | 3563 | { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0); |
212 | 212 | $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0); |
213 | 213 | //Tag tomador é identificado por toma03 na versão 2.00 |
214 | - if ($this->infCte->getAttribute("versao")=="2.00") { |
|
214 | + if ($this->infCte->getAttribute("versao") == "2.00") { |
|
215 | 215 | $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0); |
216 | 216 | } |
217 | 217 | //modal aquaviário |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | } |
457 | 457 | $x = $xInic; |
458 | 458 | $r = $this->zObs($x, $y); |
459 | - $y = $y-6; |
|
459 | + $y = $y - 6; |
|
460 | 460 | switch ($this->modal) { |
461 | 461 | case '1': |
462 | 462 | $y += 25.9; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | 'font' => $this->fontePadrao, |
660 | 660 | 'size' => 7, |
661 | 661 | 'style' => ''); |
662 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
662 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
663 | 663 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
664 | 664 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
665 | 665 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -752,31 +752,31 @@ discard block |
||
752 | 752 | $this->pdf->Line($x, $y1 + 8, $w + 3, $y1 + 8); |
753 | 753 | $toma = $this->getTagValue($this->ide, "indGlobalizado"); |
754 | 754 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros |
755 | - if ($toma==1) { |
|
755 | + if ($toma == 1) { |
|
756 | 756 | $aFont = array( |
757 | 757 | 'font' => $this->fontePadrao, |
758 | 758 | 'size' => 11, |
759 | 759 | 'style' => ''); |
760 | - $this->pTextBox($x-14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
760 | + $this->pTextBox($x - 14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
761 | 761 | } else { |
762 | 762 | $aFont = array( |
763 | 763 | 'font' => $this->fontePadrao, |
764 | 764 | 'size' => 11, |
765 | 765 | 'style' => ''); |
766 | - $this->pTextBox($x+3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
766 | + $this->pTextBox($x + 3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
767 | 767 | } |
768 | 768 | $aFont = $this->formatNegrito; |
769 | - $this->pdf->Line($x+5, $x+48, $x+5, $x+52); |
|
770 | - $this->pdf->Line($x+10, $x+48, $x+10, $x+52); |
|
771 | - $this->pdf->Line($x+5, $x+48, $x+10, $x+48); |
|
772 | - $this->pdf->Line($x+5, $x+52, $x+10, $x+52); |
|
773 | - $this->pTextBox($x-9, $y2+1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
769 | + $this->pdf->Line($x + 5, $x + 48, $x + 5, $x + 52); |
|
770 | + $this->pdf->Line($x + 10, $x + 48, $x + 10, $x + 52); |
|
771 | + $this->pdf->Line($x + 5, $x + 48, $x + 10, $x + 48); |
|
772 | + $this->pdf->Line($x + 5, $x + 52, $x + 10, $x + 52); |
|
773 | + $this->pTextBox($x - 9, $y2 + 1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
774 | 774 | |
775 | - $this->pdf->Line($x+23, $x+48, $x+23, $x+52); |
|
776 | - $this->pdf->Line($x+28, $x+48, $x+28, $x+52); |
|
777 | - $this->pdf->Line($x+23, $x+48, $x+28, $x+48); |
|
778 | - $this->pdf->Line($x+23, $x+52, $x+28, $x+52); |
|
779 | - $this->pTextBox($x+9.8, $y2+1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
775 | + $this->pdf->Line($x + 23, $x + 48, $x + 23, $x + 52); |
|
776 | + $this->pdf->Line($x + 28, $x + 48, $x + 28, $x + 52); |
|
777 | + $this->pdf->Line($x + 23, $x + 48, $x + 28, $x + 48); |
|
778 | + $this->pdf->Line($x + 23, $x + 52, $x + 28, $x + 52); |
|
779 | + $this->pTextBox($x + 9.8, $y2 + 1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
780 | 780 | |
781 | 781 | //FORMA DE PAGAMENTO |
782 | 782 | $texto = 'INFORMAÇÕES DO CT-E GLOBALIZADO'; |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | 'font' => $this->fontePadrao, |
786 | 786 | 'size' => 8, |
787 | 787 | 'style' => ''); |
788 | - $this->pTextBox($x+2 + $wa + 4.5, $y2-0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
788 | + $this->pTextBox($x + 2 + $wa + 4.5, $y2 - 0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
789 | 789 | $forma = $this->getTagValue($this->ide, "forPag"); |
790 | 790 | //################################################################## |
791 | 791 | //coluna direita |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | 'style' => ''); |
894 | 894 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
895 | 895 | //$texto = '1/1'; |
896 | - $texto = $pag."/".$totPag; |
|
896 | + $texto = $pag . "/" . $totPag; |
|
897 | 897 | $aFont = $this->formatNegrito; |
898 | 898 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
899 | 899 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | $this->pdf->SetTextColor(0, 0, 0); |
1096 | 1096 | } |
1097 | 1097 | //indicar sem valor |
1098 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
1098 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
1099 | 1099 | $x = 10; |
1100 | 1100 | if ($this->orientacao == 'P') { |
1101 | 1101 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
1119 | 1119 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1120 | 1120 | $this->pdf->SetTextColor(0, 0, 0); |
1121 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
1121 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
1122 | 1122 | $h = 5; |
1123 | 1123 | $w = $maxW - (2 * 10); |
1124 | 1124 | $x = 55; |
@@ -1136,14 +1136,14 @@ discard block |
||
1136 | 1136 | 'size' => 41, |
1137 | 1137 | 'style' => 'B'); |
1138 | 1138 | $texto = "Sem Validade Jurídica"; |
1139 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1139 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1140 | 1140 | $this->pdf->SetTextColor(90, 90, 90); |
1141 | 1141 | $texto = "SEM VALOR FISCAL"; |
1142 | 1142 | $aFont = array( |
1143 | 1143 | 'font' => $this->fontePadrao, |
1144 | 1144 | 'size' => 48, |
1145 | 1145 | 'style' => 'B'); |
1146 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1146 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1147 | 1147 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
1148 | 1148 | } else { |
1149 | 1149 | $x = 10; |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | 'size' => 6, |
1231 | 1231 | 'style' => ''); |
1232 | 1232 | $this->pTextBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
1233 | - $texto = 'Desenvolvido por '.$this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
1233 | + $texto = 'Desenvolvido por ' . $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
1234 | 1234 | $aFont = array( |
1235 | 1235 | 'font' => $this->fontePadrao, |
1236 | 1236 | 'size' => 6, |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | $aFont = $this->formatPadrao; |
1322 | 1322 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1323 | 1323 | //$texto = $this->zFormatFone($this->rem); |
1324 | - $texto = $this->getTagValue($this->rem, "fone")!=""? $this->zFormatFone($this->rem):''; |
|
1324 | + $texto = $this->getTagValue($this->rem, "fone") != "" ? $this->zFormatFone($this->rem) : ''; |
|
1325 | 1325 | $aFont = $this->formatNegrito; |
1326 | 1326 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1327 | 1327 | } //fim da função remetenteDACTE |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $aFont = $this->formatPadrao; |
1409 | 1409 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1410 | 1410 | //$texto = $this->zFormatFone($this->dest); |
1411 | - $texto = $this->getTagValue($this->dest, "fone")!=""? $this->zFormatFone($this->dest):''; |
|
1411 | + $texto = $this->getTagValue($this->dest, "fone") != "" ? $this->zFormatFone($this->dest) : ''; |
|
1412 | 1412 | $aFont = $this->formatNegrito; |
1413 | 1413 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1414 | 1414 | } //fim da função destinatarioDACTE |
@@ -1448,8 +1448,7 @@ discard block |
||
1448 | 1448 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
1449 | 1449 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
1450 | 1450 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
1451 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
1452 | - ''; |
|
1451 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
1453 | 1452 | } else { |
1454 | 1453 | $texto = ''; |
1455 | 1454 | } |
@@ -1504,7 +1503,7 @@ discard block |
||
1504 | 1503 | $aFont = $this->formatPadrao; |
1505 | 1504 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1506 | 1505 | if (isset($this->exped)) { |
1507 | - $texto = $this->getTagValue($this->exped, "fone")!=""? $this->zFormatFone($this->exped):''; |
|
1506 | + $texto = $this->getTagValue($this->exped, "fone") != "" ? $this->zFormatFone($this->exped) : ''; |
|
1508 | 1507 | $aFont = $this->formatNegrito; |
1509 | 1508 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1510 | 1509 | } |
@@ -1545,8 +1544,7 @@ discard block |
||
1545 | 1544 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
1546 | 1545 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
1547 | 1546 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
1548 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
1549 | - ''; |
|
1547 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
1550 | 1548 | } else { |
1551 | 1549 | $texto = ''; |
1552 | 1550 | } |
@@ -1601,7 +1599,7 @@ discard block |
||
1601 | 1599 | $aFont = $this->formatPadrao; |
1602 | 1600 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1603 | 1601 | if (isset($this->receb)) { |
1604 | - $texto = $this->getTagValue($this->receb, "fone")!=""? $this->zFormatFone($this->receb):''; |
|
1602 | + $texto = $this->getTagValue($this->receb, "fone") != "" ? $this->zFormatFone($this->receb) : ''; |
|
1605 | 1603 | $aFont = $this->formatNegrito; |
1606 | 1604 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1607 | 1605 | } |
@@ -1691,7 +1689,7 @@ discard block |
||
1691 | 1689 | $texto = 'FONE'; |
1692 | 1690 | $aFont = $this->formatPadrao; |
1693 | 1691 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1694 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
1692 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
1695 | 1693 | $aFont = $this->formatNegrito; |
1696 | 1694 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1697 | 1695 | } //fim da função tomadorDACTE |
@@ -1759,46 +1757,46 @@ discard block |
||
1759 | 1757 | 'font' => $this->fontePadrao, |
1760 | 1758 | 'size' => 5, |
1761 | 1759 | 'style' => ''); |
1762 | - $this->pTextBox($x+8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1760 | + $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1763 | 1761 | $texto = number_format($qCarga, 3, ",", "."); |
1764 | 1762 | $aFont = array( |
1765 | 1763 | 'font' => $this->fontePadrao, |
1766 | 1764 | 'size' => 7, |
1767 | 1765 | 'style' => 'B'); |
1768 | - $this->pTextBox($x+2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1766 | + $this->pTextBox($x + 2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1769 | 1767 | $x = $w * 0.12; |
1770 | - $this->pdf->Line($x+13.5, $y, $x+13.5, $y + 9); |
|
1768 | + $this->pdf->Line($x + 13.5, $y, $x + 13.5, $y + 9); |
|
1771 | 1769 | $texto = 'PESO BASE CÁLCULO (KG)'; |
1772 | 1770 | $aFont = array( |
1773 | 1771 | 'font' => $this->fontePadrao, |
1774 | 1772 | 'size' => 5, |
1775 | 1773 | 'style' => ''); |
1776 | - $this->pTextBox($x+20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1774 | + $this->pTextBox($x + 20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1777 | 1775 | $texto = number_format($qCarga, 3, ",", "."); |
1778 | 1776 | $aFont = array( |
1779 | 1777 | 'font' => $this->fontePadrao, |
1780 | 1778 | 'size' => 7, |
1781 | 1779 | 'style' => 'B'); |
1782 | - $this->pTextBox($x+17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1780 | + $this->pTextBox($x + 17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1783 | 1781 | $x = $w * 0.24; |
1784 | - $this->pdf->Line($x+25, $y, $x+25, $y + 9); |
|
1782 | + $this->pdf->Line($x + 25, $y, $x + 25, $y + 9); |
|
1785 | 1783 | $texto = 'PESO AFERIDO (KG)'; |
1786 | 1784 | $aFont = array( |
1787 | 1785 | 'font' => $this->fontePadrao, |
1788 | 1786 | 'size' => 5, |
1789 | 1787 | 'style' => ''); |
1790 | - $this->pTextBox($x+35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1788 | + $this->pTextBox($x + 35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1791 | 1789 | $texto = number_format($qCarga, 3, ",", "."); |
1792 | 1790 | $aFont = array( |
1793 | 1791 | 'font' => $this->fontePadrao, |
1794 | 1792 | 'size' => 7, |
1795 | 1793 | 'style' => 'B'); |
1796 | - $this->pTextBox($x+28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1794 | + $this->pTextBox($x + 28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1797 | 1795 | $x = $w * 0.36; |
1798 | - $this->pdf->Line($x+41.3, $y, $x+41.3, $y + 9); |
|
1796 | + $this->pdf->Line($x + 41.3, $y, $x + 41.3, $y + 9); |
|
1799 | 1797 | $texto = 'CUBAGEM(M3)'; |
1800 | 1798 | $aFont = $this->formatPadrao; |
1801 | - $this->pTextBox($x+60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1799 | + $this->pTextBox($x + 60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1802 | 1800 | $qCarga = ''; |
1803 | 1801 | foreach ($this->infQ as $infQ) { |
1804 | 1802 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
@@ -1810,12 +1808,12 @@ discard block |
||
1810 | 1808 | 'font' => $this->fontePadrao, |
1811 | 1809 | 'size' => 7, |
1812 | 1810 | 'style' => 'B'); |
1813 | - $this->pTextBox($x+50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1811 | + $this->pTextBox($x + 50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1814 | 1812 | $x = $w * 0.45; |
1815 | 1813 | //$this->pdf->Line($x+37, $y, $x+37, $y + 9); |
1816 | 1814 | $texto = 'QTDE(VOL)'; |
1817 | 1815 | $aFont = $this->formatPadrao; |
1818 | - $this->pTextBox($x+85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1816 | + $this->pTextBox($x + 85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1819 | 1817 | $qCarga = ''; |
1820 | 1818 | foreach ($this->infQ as $infQ) { |
1821 | 1819 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
@@ -1827,9 +1825,9 @@ discard block |
||
1827 | 1825 | 'font' => $this->fontePadrao, |
1828 | 1826 | 'size' => 7, |
1829 | 1827 | 'style' => 'B'); |
1830 | - $this->pTextBox($x+85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1828 | + $this->pTextBox($x + 85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1831 | 1829 | $x = $w * 0.53; |
1832 | - $this->pdf->Line($x+56, $y, $x+56, $y + 9); |
|
1830 | + $this->pdf->Line($x + 56, $y, $x + 56, $y + 9); |
|
1833 | 1831 | /*$texto = 'NOME DA SEGURADORA'; |
1834 | 1832 | $aFont = $this->formatPadrao; |
1835 | 1833 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2008,7 +2006,7 @@ discard block |
||
2008 | 2006 | $aFont = $this->formatPadrao; |
2009 | 2007 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2010 | 2008 | |
2011 | - $wCol02=0.15; |
|
2009 | + $wCol02 = 0.15; |
|
2012 | 2010 | $x += $w * $wCol02; |
2013 | 2011 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
2014 | 2012 | $texto = 'ALÍQ ICMS'; |
@@ -2334,7 +2332,7 @@ discard block |
||
2334 | 2332 | $this->arrayNFe[] = $chaveNFe; |
2335 | 2333 | } |
2336 | 2334 | $qtdeNFe = 1; |
2337 | - if (count($this->arrayNFe) >15) { |
|
2335 | + if (count($this->arrayNFe) > 15) { |
|
2338 | 2336 | $this->flagDocOrigContinuacao = 1; |
2339 | 2337 | $qtdeNFe = count($this->arrayNFe); |
2340 | 2338 | } |
@@ -2514,9 +2512,9 @@ discard block |
||
2514 | 2512 | //$h = 6 + 3; // de altura do texto (primeira linha |
2515 | 2513 | //$h = 9 + 3.5 ;// segunda linha |
2516 | 2514 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
2517 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
2518 | - if (count($this->arrayNFe)%2 !=0) { |
|
2519 | - $h = $h+3.5; |
|
2515 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
2516 | + if (count($this->arrayNFe) % 2 != 0) { |
|
2517 | + $h = $h + 3.5; |
|
2520 | 2518 | } // Caso tenha apenas 1 registro na ultima linha |
2521 | 2519 | |
2522 | 2520 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
@@ -2574,7 +2572,7 @@ discard block |
||
2574 | 2572 | $yIniDados += 3; |
2575 | 2573 | |
2576 | 2574 | while ($contador < (count($this->arrayNFe))) { |
2577 | - if ($contador%(116*($i-1)) == 0) { |
|
2575 | + if ($contador % (116 * ($i - 1)) == 0) { |
|
2578 | 2576 | // $contador++; |
2579 | 2577 | break; |
2580 | 2578 | } |
@@ -2717,14 +2715,14 @@ discard block |
||
2717 | 2715 | $texto .= $xObs; |
2718 | 2716 | } |
2719 | 2717 | $textoObs = explode("Motorista:", $texto); |
2720 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
2718 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
2721 | 2719 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
2722 | 2720 | $aFont = array( |
2723 | 2721 | 'font' => $this->fontePadrao, |
2724 | 2722 | 'size' => 7.5, |
2725 | 2723 | 'style' => ''); |
2726 | 2724 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
2727 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
2725 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
2728 | 2726 | } //fim da função obsDACTE |
2729 | 2727 | |
2730 | 2728 | /** |
@@ -2763,11 +2761,11 @@ discard block |
||
2763 | 2761 | $this->pTextBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2764 | 2762 | $x += $w * 0.23; |
2765 | 2763 | |
2766 | - $this->pdf->Line($x-20, $y, $x-20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2764 | + $this->pdf->Line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2767 | 2765 | |
2768 | 2766 | $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR'; |
2769 | 2767 | $aFont = $this->formatPadrao; |
2770 | - $this->pTextBox($x-20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
2768 | + $this->pTextBox($x - 20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
2771 | 2769 | } //fim da função zModalRod |
2772 | 2770 | |
2773 | 2771 | /** |
@@ -2801,13 +2799,13 @@ discard block |
||
2801 | 2799 | |
2802 | 2800 | $texto = 'CLASSE DA TARIFA'; |
2803 | 2801 | $aFont = $this->formatPadrao; |
2804 | - $this->pTextBox($x+50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2802 | + $this->pTextBox($x + 50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2805 | 2803 | $texto = 'CÓDIGO DA TARIFA'; |
2806 | 2804 | $aFont = $this->formatPadrao; |
2807 | - $this->pTextBox($x+80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2805 | + $this->pTextBox($x + 80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2808 | 2806 | $texto = 'VALOR DA TARIFA'; |
2809 | 2807 | $aFont = $this->formatPadrao; |
2810 | - $this->pTextBox($x+110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2808 | + $this->pTextBox($x + 110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2811 | 2809 | |
2812 | 2810 | $texto = $this->getTagValue($this->aereo, "nOCA"); |
2813 | 2811 | $aFont = $this->formatNegrito; |
@@ -3291,7 +3289,7 @@ discard block |
||
3291 | 3289 | */ |
3292 | 3290 | protected function zCanhoto($x = 0, $y = 0) |
3293 | 3291 | { |
3294 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
3292 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
3295 | 3293 | $y = $y + 2; |
3296 | 3294 | $oldX = $x; |
3297 | 3295 | $oldY = $y; |
@@ -3330,7 +3328,7 @@ discard block |
||
3330 | 3328 | |
3331 | 3329 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
3332 | 3330 | |
3333 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
3331 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
3334 | 3332 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
3335 | 3333 | $aFont = array( |
3336 | 3334 | 'font' => $this->fontePadrao, |
@@ -3340,14 +3338,14 @@ discard block |
||
3340 | 3338 | $x = $oldX; |
3341 | 3339 | $y = $y + 5; |
3342 | 3340 | |
3343 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3341 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3344 | 3342 | |
3345 | 3343 | $texto = 'RG'; |
3346 | 3344 | $aFont = array( |
3347 | 3345 | 'font' => $this->fontePadrao, |
3348 | 3346 | 'size' => 6, |
3349 | 3347 | 'style' => ''); |
3350 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3348 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3351 | 3349 | $x += $w * 0.85; |
3352 | 3350 | |
3353 | 3351 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -795,15 +795,15 @@ |
||
795 | 795 | $this->setDrawColor(0); |
796 | 796 | } |
797 | 797 | |
798 | - /** |
|
799 | - * Desenha uma linha vertical tracejada com o FPDF |
|
800 | - * @param number $x Posição horizontal inicial, em mm |
|
801 | - * @param number $y Posição vertical inicial, em mm |
|
802 | - * @param number $w Comprimento da linha, em mm |
|
803 | - * @param number $yfinal Espessura da linha, em mm |
|
804 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
805 | - * @return none |
|
806 | - */ |
|
798 | + /** |
|
799 | + * Desenha uma linha vertical tracejada com o FPDF |
|
800 | + * @param number $x Posição horizontal inicial, em mm |
|
801 | + * @param number $y Posição vertical inicial, em mm |
|
802 | + * @param number $w Comprimento da linha, em mm |
|
803 | + * @param number $yfinal Espessura da linha, em mm |
|
804 | + * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
805 | + * @return none |
|
806 | + */ |
|
807 | 807 | public function dashedVLine($x, $y, $w, $yfinal, $n) |
808 | 808 | { |
809 | 809 | $this->setLineWidth($w); |
@@ -162,6 +162,9 @@ discard block |
||
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Imprime barcode 128 |
165 | + * @param double $x |
|
166 | + * @param double $y |
|
167 | + * @param integer $h |
|
165 | 168 | */ |
166 | 169 | public function code128($x, $y, $code, $w, $h) |
167 | 170 | { |
@@ -237,8 +240,8 @@ discard block |
||
237 | 240 | /** |
238 | 241 | * Rotaciona para impressão paisagem (landscape) |
239 | 242 | * @param number $angle |
240 | - * @param number $x |
|
241 | - * @param number $y |
|
243 | + * @param integer $x |
|
244 | + * @param integer $y |
|
242 | 245 | */ |
243 | 246 | public function rotate($angle, $x = -1, $y = -1) |
244 | 247 | { |
@@ -335,12 +338,12 @@ discard block |
||
335 | 338 | |
336 | 339 | /** |
337 | 340 | * Desenha o arco para arredondar o canto do retangulo |
338 | - * @param number $x1 |
|
339 | - * @param number $y1 |
|
340 | - * @param number $x2 |
|
341 | - * @param number $y2 |
|
342 | - * @param number $x3 |
|
343 | - * @param number $y3 |
|
341 | + * @param double $x1 |
|
342 | + * @param double $y1 |
|
343 | + * @param double $x2 |
|
344 | + * @param double $y2 |
|
345 | + * @param double $x3 |
|
346 | + * @param double $y3 |
|
344 | 347 | */ |
345 | 348 | private function arc($x1, $y1, $x2, $y2, $x3, $y3) |
346 | 349 | { |
@@ -364,8 +367,8 @@ discard block |
||
364 | 367 | * @param number $y1 |
365 | 368 | * @param number $x2 |
366 | 369 | * @param number $y2 |
367 | - * @param number $width |
|
368 | - * @param number $nb |
|
370 | + * @param integer $width |
|
371 | + * @param integer $nb |
|
369 | 372 | */ |
370 | 373 | public function dashedRect($x1, $y1, $x2, $y2, $width = 1, $nb = 15) |
371 | 374 | { |
@@ -432,11 +435,11 @@ discard block |
||
432 | 435 | * @param number $w |
433 | 436 | * @param number $h |
434 | 437 | * @param string $txt |
435 | - * @param string $border |
|
438 | + * @param integer $border |
|
436 | 439 | * @param string $align |
437 | 440 | * @param boolean $fill |
438 | - * @param number $maxline |
|
439 | - * @param number $prn |
|
441 | + * @param integer $maxline |
|
442 | + * @param integer $prn |
|
440 | 443 | * @return int |
441 | 444 | */ |
442 | 445 | private function drawRows($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $maxline = 0, $prn = 0) |
@@ -565,8 +568,8 @@ discard block |
||
565 | 568 | |
566 | 569 | /** |
567 | 570 | * Quebra o texto para caber na caixa |
568 | - * @param type $text |
|
569 | - * @param type $maxwidth |
|
571 | + * @param string $text |
|
572 | + * @param double $maxwidth |
|
570 | 573 | * @return int |
571 | 574 | */ |
572 | 575 | public function wordWrap(&$text, $maxwidth) |
@@ -616,10 +619,10 @@ discard block |
||
616 | 619 | /** |
617 | 620 | * Celula com escala horizontal caso o texto seja muito largo |
618 | 621 | * @param number $w |
619 | - * @param number $h |
|
622 | + * @param integer $h |
|
620 | 623 | * @param string $txt |
621 | - * @param number $border |
|
622 | - * @param number $ln |
|
624 | + * @param integer $border |
|
625 | + * @param integer $ln |
|
623 | 626 | * @param string $align |
624 | 627 | * @param boolean $fill |
625 | 628 | * @param string $link |
@@ -670,10 +673,10 @@ discard block |
||
670 | 673 | /** |
671 | 674 | * Celula com escalamento horizontal somente se necessário |
672 | 675 | * @param number $w |
673 | - * @param number $h |
|
676 | + * @param integer $h |
|
674 | 677 | * @param string $txt |
675 | - * @param number $border |
|
676 | - * @param number $ln |
|
678 | + * @param integer $border |
|
679 | + * @param integer $ln |
|
677 | 680 | * @param string $align |
678 | 681 | * @param boolean $fill |
679 | 682 | * @param string $link |
@@ -686,10 +689,10 @@ discard block |
||
686 | 689 | /** |
687 | 690 | * Celula com escalamento forçado |
688 | 691 | * @param number $w |
689 | - * @param number $h |
|
692 | + * @param integer $h |
|
690 | 693 | * @param string $txt |
691 | - * @param number $border |
|
692 | - * @param number $ln |
|
694 | + * @param integer $border |
|
695 | + * @param integer $ln |
|
693 | 696 | * @param string $align |
694 | 697 | * @param boolean $fill |
695 | 698 | * @param string $link |
@@ -710,10 +713,10 @@ discard block |
||
710 | 713 | /** |
711 | 714 | * Celula com espaçamento de caracteres somente se necessário |
712 | 715 | * @param number $w |
713 | - * @param number $h |
|
716 | + * @param integer $h |
|
714 | 717 | * @param string $txt |
715 | - * @param number $border |
|
716 | - * @param number $ln |
|
718 | + * @param integer $border |
|
719 | + * @param integer $ln |
|
717 | 720 | * @param string $align |
718 | 721 | * @param boolean $fill |
719 | 722 | * @param string $link |
@@ -726,10 +729,10 @@ discard block |
||
726 | 729 | /** |
727 | 730 | * Celula com espaçamento de caracteres forçado |
728 | 731 | * @param number $w |
729 | - * @param number $h |
|
732 | + * @param integer $h |
|
730 | 733 | * @param string $txt |
731 | - * @param number $border |
|
732 | - * @param number $ln |
|
734 | + * @param integer $border |
|
735 | + * @param integer $ln |
|
733 | 736 | * @param string $align |
734 | 737 | * @param boolean $fill |
735 | 738 | * @param string $link |
@@ -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 = array("A"=>103, "B"=>104, "C"=>105); // Caracteres de seleção do grupo 128 |
|
17 | - private $jSwap = array("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 = array("A"=>103, "B"=>104, "C"=>105); // Caracteres de seleção do grupo 128 |
|
17 | + private $jSwap = array("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); |
|
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)); |
|
321 | + $this->arc($xc - $r * $MyArc, $yc + $r, $xc - $r, $yc + $r * $MyArc, $xc - $r, $yc); |
|
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)); |
|
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,27 +585,27 @@ 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 | } |
599 | 599 | } elseif ($width + $wordwidth <= $maxwidth) { |
600 | 600 | $width += $wordwidth + $space; |
601 | - $text .= $word.' '; |
|
601 | + $text .= $word . ' '; |
|
602 | 602 | } else { |
603 | 603 | $width = $wordwidth + $space; |
604 | - $text = rtrim($text)."\n".$word.' '; |
|
604 | + $text = rtrim($text) . "\n" . $word . ' '; |
|
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 | } |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
237 | 237 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
238 | 238 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
239 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
239 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
240 | 240 | * @param string $link Insere um hiperlink |
241 | 241 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
242 | 242 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
243 | 243 | * e para isso atera o tamanho do fonte até caber no espaço, |
244 | 244 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
245 | - * @param number $hmax |
|
246 | - * @param number $vOffSet incremento forçado na na posição Y |
|
245 | + * @param integer $hmax |
|
246 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
247 | 247 | * @return number $height Qual a altura necessária para desenhar esta textBox |
248 | 248 | */ |
249 | 249 | protected function pTextBox( |
@@ -363,20 +363,20 @@ discard block |
||
363 | 363 | * 'size'=>10,'style='B'),'C','L',FALSE,'http://www.nfephp.org') |
364 | 364 | * @param number $x Posição horizontal da caixa, canto esquerdo superior |
365 | 365 | * @param number $y Posição vertical da caixa, canto esquerdo superior |
366 | - * @param number $w Largura da caixa |
|
367 | - * @param number $h Altura da caixa |
|
366 | + * @param double $w Largura da caixa |
|
367 | + * @param integer $h Altura da caixa |
|
368 | 368 | * @param string $text Conteúdo da caixa |
369 | 369 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
370 | 370 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
371 | 371 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
372 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
372 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
373 | 373 | * @param string $link Insere um hiperlink |
374 | 374 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
375 | 375 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
376 | 376 | * linha e para isso atera o tamanho do fonte até caber no espaço, |
377 | 377 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
378 | - * @param number $hmax |
|
379 | - * @param number $vOffSet incremento forçado na na posição Y |
|
378 | + * @param integer $hmax |
|
379 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
380 | 380 | * @return number $height Qual a altura necessária para desenhar esta textBox |
381 | 381 | */ |
382 | 382 | protected function pTextBox90( |
@@ -490,6 +490,9 @@ discard block |
||
490 | 490 | return ($y1 - $y) - $incY; |
491 | 491 | } |
492 | 492 | |
493 | + /** |
|
494 | + * @param string $tPag |
|
495 | + */ |
|
493 | 496 | protected function tipoPag($tPag) |
494 | 497 | { |
495 | 498 | switch ($tPag) { |
@@ -170,6 +170,9 @@ discard block |
||
170 | 170 | $this->pdfVersion='1.3'; |
171 | 171 | } |
172 | 172 | |
173 | + /** |
|
174 | + * @param integer $right |
|
175 | + */ |
|
173 | 176 | public function setMargins($left, $top, $right = null) |
174 | 177 | { |
175 | 178 | //Set left, top and right margins |
@@ -202,6 +205,9 @@ discard block |
||
202 | 205 | $this->rMargin = $margin; |
203 | 206 | } |
204 | 207 | |
208 | + /** |
|
209 | + * @param boolean $auto |
|
210 | + */ |
|
205 | 211 | public function setAutoPageBreak($auto, $margin = 0) |
206 | 212 | { |
207 | 213 | //Set auto page break mode and triggering margin |
@@ -210,6 +216,9 @@ discard block |
||
210 | 216 | $this->pageBreakTrigger = $this->h-$margin; |
211 | 217 | } |
212 | 218 | |
219 | + /** |
|
220 | + * @param string $zoom |
|
221 | + */ |
|
213 | 222 | public function setDisplayMode($zoom, $layout = 'continuous') |
214 | 223 | { |
215 | 224 | //Set display mode in viewer |
@@ -225,6 +234,9 @@ discard block |
||
225 | 234 | } |
226 | 235 | } |
227 | 236 | |
237 | + /** |
|
238 | + * @param boolean $compress |
|
239 | + */ |
|
228 | 240 | public function setCompression($compress) |
229 | 241 | { |
230 | 242 | //Set page compression |
@@ -286,6 +298,9 @@ discard block |
||
286 | 298 | $this->aliasNbPages=$alias; |
287 | 299 | } |
288 | 300 | |
301 | + /** |
|
302 | + * @param string $msg |
|
303 | + */ |
|
289 | 304 | public function error($msg) |
290 | 305 | { |
291 | 306 | throw new Exception($msg); |
@@ -401,6 +416,11 @@ discard block |
||
401 | 416 | return $this->page; |
402 | 417 | } |
403 | 418 | |
419 | + /** |
|
420 | + * @param integer $r |
|
421 | + * @param integer $g |
|
422 | + * @param integer $b |
|
423 | + */ |
|
404 | 424 | public function setDrawColor($r, $g = null, $b = null) |
405 | 425 | { |
406 | 426 | //Set color for all stroking operations |
@@ -414,6 +434,11 @@ discard block |
||
414 | 434 | } |
415 | 435 | } |
416 | 436 | |
437 | + /** |
|
438 | + * @param integer $r |
|
439 | + * @param integer $g |
|
440 | + * @param integer $b |
|
441 | + */ |
|
417 | 442 | public function setFillColor($r, $g = null, $b = null) |
418 | 443 | { |
419 | 444 | //Set color for all filling operations |
@@ -428,6 +453,11 @@ discard block |
||
428 | 453 | } |
429 | 454 | } |
430 | 455 | |
456 | + /** |
|
457 | + * @param integer $r |
|
458 | + * @param integer $g |
|
459 | + * @param integer $b |
|
460 | + */ |
|
431 | 461 | public function settextColor($r, $g = null, $b = null) |
432 | 462 | { |
433 | 463 | //Set color for text |
@@ -556,6 +586,9 @@ discard block |
||
556 | 586 | } |
557 | 587 | } |
558 | 588 | |
589 | + /** |
|
590 | + * @param string $family |
|
591 | + */ |
|
559 | 592 | public function setFont($family, $style = '', $size = 0) |
560 | 593 | { |
561 | 594 | //Select a font; size given in points |
@@ -654,6 +687,10 @@ discard block |
||
654 | 687 | $this->links[$link] = array($page, $y); |
655 | 688 | } |
656 | 689 | |
690 | + /** |
|
691 | + * @param double $y |
|
692 | + * @param string $link |
|
693 | + */ |
|
657 | 694 | public function link($x, $y, $w, $h, $link) |
658 | 695 | { |
659 | 696 | //Put a link on the page |
@@ -990,6 +1027,9 @@ discard block |
||
990 | 1027 | } |
991 | 1028 | } |
992 | 1029 | |
1030 | + /** |
|
1031 | + * @param string $file |
|
1032 | + */ |
|
993 | 1033 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
994 | 1034 | { |
995 | 1035 | //Put an image on the page |
@@ -1195,6 +1235,9 @@ discard block |
||
1195 | 1235 | } |
1196 | 1236 | |
1197 | 1237 | |
1238 | + /** |
|
1239 | + * @param string $format |
|
1240 | + */ |
|
1198 | 1241 | protected function getpageformat($format) |
1199 | 1242 | { |
1200 | 1243 | $format=strtolower($format); |
@@ -1215,6 +1258,10 @@ discard block |
||
1215 | 1258 | } |
1216 | 1259 | |
1217 | 1260 | |
1261 | + /** |
|
1262 | + * @param string $orientation |
|
1263 | + * @param string $format |
|
1264 | + */ |
|
1218 | 1265 | protected function beginPage($orientation, $format) |
1219 | 1266 | { |
1220 | 1267 | $this->page++; |
@@ -1360,6 +1407,9 @@ discard block |
||
1360 | 1407 | } |
1361 | 1408 | |
1362 | 1409 | |
1410 | + /** |
|
1411 | + * @param string $file |
|
1412 | + */ |
|
1363 | 1413 | protected function parsePNG($file) |
1364 | 1414 | { |
1365 | 1415 | //Extract info from a PNG file |
@@ -8,64 +8,64 @@ discard block |
||
8 | 8 | { |
9 | 9 | const FPDF_VERSION = '1.6'; |
10 | 10 | |
11 | - public $page; //current page number |
|
12 | - public $n; //current object number |
|
13 | - public $offsets; //array of object offsets |
|
14 | - public $buffer; //buffer holding in-memory PDF |
|
15 | - public $pages; //array containing pages |
|
16 | - public $state; //current document state |
|
17 | - public $compress; //compression flag |
|
18 | - public $k; //scale factor (number of points in user unit) |
|
19 | - public $defOrientation; //default orientation |
|
20 | - public $curOrientation; //current orientation |
|
21 | - public $pageFormats; //available page formats |
|
22 | - public $defPageFormat; //default page format |
|
23 | - public $curPageFormat; //current page format |
|
24 | - public $pageSizes; //array storing non-default page sizes |
|
11 | + public $page; //current page number |
|
12 | + public $n; //current object number |
|
13 | + public $offsets; //array of object offsets |
|
14 | + public $buffer; //buffer holding in-memory PDF |
|
15 | + public $pages; //array containing pages |
|
16 | + public $state; //current document state |
|
17 | + public $compress; //compression flag |
|
18 | + public $k; //scale factor (number of points in user unit) |
|
19 | + public $defOrientation; //default orientation |
|
20 | + public $curOrientation; //current orientation |
|
21 | + public $pageFormats; //available page formats |
|
22 | + public $defPageFormat; //default page format |
|
23 | + public $curPageFormat; //current page format |
|
24 | + public $pageSizes; //array storing non-default page sizes |
|
25 | 25 | public $wPt; |
26 | - public $hPt; //dimensions of current page in points |
|
26 | + public $hPt; //dimensions of current page in points |
|
27 | 27 | public $w; |
28 | - public $h; //dimensions of current page in user unit |
|
29 | - public $lMargin; //left margin |
|
30 | - public $tMargin; //top margin |
|
31 | - public $rMargin; //right margin |
|
32 | - public $bMargin; //page break margin |
|
33 | - public $cMargin; //cell margin |
|
28 | + public $h; //dimensions of current page in user unit |
|
29 | + public $lMargin; //left margin |
|
30 | + public $tMargin; //top margin |
|
31 | + public $rMargin; //right margin |
|
32 | + public $bMargin; //page break margin |
|
33 | + public $cMargin; //cell margin |
|
34 | 34 | public $x; |
35 | - public $y; //current position in user unit |
|
36 | - public $lasth; //height of last printed cell |
|
37 | - public $lineWidth; //line width in user unit |
|
38 | - public $coreFonts; //array of standard font names |
|
39 | - public $fonts; //array of used fonts |
|
40 | - public $fontFiles; //array of font files |
|
41 | - public $diffs; //array of encoding differences |
|
42 | - public $fontFamily; //current font family |
|
43 | - public $fontStyle; //current font style |
|
44 | - public $underline; //underlining flag |
|
45 | - public $currentFont; //current font info |
|
46 | - public $fontSizePt; //current font size in points |
|
47 | - public $fontSize; //current font size in user unit |
|
48 | - public $drawColor; //commands for drawing color |
|
49 | - public $fillColor; //commands for filling color |
|
50 | - public $textColor; //commands for text color |
|
51 | - public $colorFlag; //indicates whether fill and text colors are different |
|
52 | - public $ws; //word spacing |
|
53 | - public $images; //array of used images |
|
54 | - public $PageLinks; //array of links in pages |
|
55 | - public $links; //array of internal links |
|
56 | - public $autoPageBreak; //automatic page breaking |
|
57 | - public $pageBreakTrigger; //threshold used to trigger page breaks |
|
58 | - public $inHeader; //flag set when processing header |
|
59 | - public $inFooter; //flag set when processing footer |
|
60 | - public $zoomMode; //zoom display mode |
|
61 | - public $layoutMode; //layout display mode |
|
62 | - public $title; //title |
|
63 | - public $subject; //subject |
|
64 | - public $author; //author |
|
65 | - public $keywords; //keywords |
|
66 | - public $creator; //creator |
|
67 | - public $aliasNbPages; //alias for total number of pages |
|
68 | - public $pdfVersion; //PDF version number |
|
35 | + public $y; //current position in user unit |
|
36 | + public $lasth; //height of last printed cell |
|
37 | + public $lineWidth; //line width in user unit |
|
38 | + public $coreFonts; //array of standard font names |
|
39 | + public $fonts; //array of used fonts |
|
40 | + public $fontFiles; //array of font files |
|
41 | + public $diffs; //array of encoding differences |
|
42 | + public $fontFamily; //current font family |
|
43 | + public $fontStyle; //current font style |
|
44 | + public $underline; //underlining flag |
|
45 | + public $currentFont; //current font info |
|
46 | + public $fontSizePt; //current font size in points |
|
47 | + public $fontSize; //current font size in user unit |
|
48 | + public $drawColor; //commands for drawing color |
|
49 | + public $fillColor; //commands for filling color |
|
50 | + public $textColor; //commands for text color |
|
51 | + public $colorFlag; //indicates whether fill and text colors are different |
|
52 | + public $ws; //word spacing |
|
53 | + public $images; //array of used images |
|
54 | + public $PageLinks; //array of links in pages |
|
55 | + public $links; //array of internal links |
|
56 | + public $autoPageBreak; //automatic page breaking |
|
57 | + public $pageBreakTrigger; //threshold used to trigger page breaks |
|
58 | + public $inHeader; //flag set when processing header |
|
59 | + public $inFooter; //flag set when processing footer |
|
60 | + public $zoomMode; //zoom display mode |
|
61 | + public $layoutMode; //layout display mode |
|
62 | + public $title; //title |
|
63 | + public $subject; //subject |
|
64 | + public $author; //author |
|
65 | + public $keywords; //keywords |
|
66 | + public $creator; //creator |
|
67 | + public $aliasNbPages; //alias for total number of pages |
|
68 | + public $pdfVersion; //PDF version number |
|
69 | 69 | |
70 | 70 | public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4') |
71 | 71 | { |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | if ($unit == 'pt') { |
117 | 117 | $this->k = 1; |
118 | 118 | } elseif ($unit == 'mm') { |
119 | - $this->k = 72/25.4; |
|
119 | + $this->k = 72 / 25.4; |
|
120 | 120 | } elseif ($unit == 'cm') { |
121 | - $this->k = 72/2.54; |
|
121 | + $this->k = 72 / 2.54; |
|
122 | 122 | } elseif ($unit == 'in') { |
123 | 123 | $this->k = 72; |
124 | 124 | } else { |
125 | - $this->error('Incorrect unit: '.$unit); |
|
125 | + $this->error('Incorrect unit: ' . $unit); |
|
126 | 126 | } |
127 | 127 | //Page format |
128 | 128 | $this->pageFormats = array( |
129 | - 'a3' => array(841.89,1190.55), |
|
130 | - 'a4' => array(595.28,841.89), |
|
131 | - 'a5' => array(420.94,595.28), |
|
132 | - 'letter' => array(612,792), |
|
133 | - 'legal' => array(612,1008) |
|
129 | + 'a3' => array(841.89, 1190.55), |
|
130 | + 'a4' => array(595.28, 841.89), |
|
131 | + 'a5' => array(420.94, 595.28), |
|
132 | + 'letter' => array(612, 792), |
|
133 | + 'legal' => array(612, 1008) |
|
134 | 134 | ); |
135 | 135 | if (is_string($format)) { |
136 | 136 | $format = $this->getpageformat($format); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | //Page orientation |
141 | 141 | $orientation = strtolower($orientation); |
142 | 142 | if ($orientation == 'p' || $orientation == 'portrait') { |
143 | - $this->defOrientation='P'; |
|
143 | + $this->defOrientation = 'P'; |
|
144 | 144 | $this->w = $this->defPageFormat[0]; |
145 | 145 | $this->h = $this->defPageFormat[1]; |
146 | 146 | } elseif ($orientation == 'l' || $orientation == 'landscape') { |
@@ -148,26 +148,26 @@ discard block |
||
148 | 148 | $this->w = $this->defPageFormat[1]; |
149 | 149 | $this->h = $this->defPageFormat[0]; |
150 | 150 | } else { |
151 | - $this->error('Incorrect orientation: '.$orientation); |
|
151 | + $this->error('Incorrect orientation: ' . $orientation); |
|
152 | 152 | } |
153 | 153 | $this->curOrientation = $this->defOrientation; |
154 | - $this->wPt = $this->w*$this->k; |
|
155 | - $this->hPt = $this->h*$this->k; |
|
154 | + $this->wPt = $this->w * $this->k; |
|
155 | + $this->hPt = $this->h * $this->k; |
|
156 | 156 | //Page margins (1 cm) |
157 | - $margin = 28.35/$this->k; |
|
157 | + $margin = 28.35 / $this->k; |
|
158 | 158 | $this->setMargins($margin, $margin); |
159 | 159 | //Interior cell margin (1 mm) |
160 | - $this->cMargin = $margin/10; |
|
160 | + $this->cMargin = $margin / 10; |
|
161 | 161 | //Line width (0.2 mm) |
162 | - $this->lineWidth = .567/$this->k; |
|
162 | + $this->lineWidth = .567 / $this->k; |
|
163 | 163 | //Automatic page break |
164 | - $this->setAutoPageBreak(true, 2*$margin); |
|
164 | + $this->setAutoPageBreak(true, 2 * $margin); |
|
165 | 165 | //Full width display mode |
166 | 166 | $this->setDisplayMode('fullwidth'); |
167 | 167 | //Enable compression |
168 | 168 | $this->setCompression(true); |
169 | 169 | //Set default PDF version number |
170 | - $this->pdfVersion='1.3'; |
|
170 | + $this->pdfVersion = '1.3'; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | public function setMargins($left, $top, $right = null) |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | if ($right === null) { |
179 | 179 | $right = $left; |
180 | 180 | } |
181 | - $this->rMargin=$right; |
|
181 | + $this->rMargin = $right; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public function setLeftMargin($margin) |
185 | 185 | { |
186 | 186 | //Set left margin |
187 | 187 | $this->lMargin = $margin; |
188 | - if ($this->page>0 && $this->x<$margin) { |
|
188 | + if ($this->page > 0 && $this->x < $margin) { |
|
189 | 189 | $this->x = $margin; |
190 | 190 | } |
191 | 191 | } |
@@ -207,21 +207,21 @@ discard block |
||
207 | 207 | //Set auto page break mode and triggering margin |
208 | 208 | $this->autoPageBreak = $auto; |
209 | 209 | $this->bMargin = $margin; |
210 | - $this->pageBreakTrigger = $this->h-$margin; |
|
210 | + $this->pageBreakTrigger = $this->h - $margin; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | public function setDisplayMode($zoom, $layout = 'continuous') |
214 | 214 | { |
215 | 215 | //Set display mode in viewer |
216 | - if ($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) { |
|
216 | + if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) { |
|
217 | 217 | $this->zoomMode = $zoom; |
218 | 218 | } else { |
219 | - $this->error('Incorrect zoom display mode: '.$zoom); |
|
219 | + $this->error('Incorrect zoom display mode: ' . $zoom); |
|
220 | 220 | } |
221 | - if ($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') { |
|
221 | + if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') { |
|
222 | 222 | $this->layoutMode = $layout; |
223 | 223 | } else { |
224 | - $this->error('Incorrect layout display mode: '.$layout); |
|
224 | + $this->error('Incorrect layout display mode: ' . $layout); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if ($isUTF8) { |
260 | 260 | $author = $this->utf8Toutf16($author); |
261 | 261 | } |
262 | - $this->author=$author; |
|
262 | + $this->author = $author; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | public function setKeywords($keywords, $isUTF8 = false) |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | public function aliasNbPages($alias = '{nb}') |
284 | 284 | { |
285 | 285 | //Define an alias for total number of pages |
286 | - $this->aliasNbPages=$alias; |
|
286 | + $this->aliasNbPages = $alias; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | public function error($msg) |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $this->open(); |
323 | 323 | } |
324 | 324 | $family = $this->fontFamily; |
325 | - $style = $this->fontStyle.($this->underline ? 'U' : ''); |
|
325 | + $style = $this->fontStyle . ($this->underline ? 'U' : ''); |
|
326 | 326 | $size = $this->fontSizePt; |
327 | 327 | $lw = $this->lineWidth; |
328 | 328 | $dc = $this->drawColor; |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | $this->out('2 J'); |
344 | 344 | //Set line width |
345 | 345 | $this->lineWidth = $lw; |
346 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
346 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
347 | 347 | //Set font |
348 | 348 | if ($family) { |
349 | 349 | $this->setFont($family, $style, $size); |
350 | 350 | } |
351 | 351 | //Set colors |
352 | 352 | $this->drawColor = $dc; |
353 | - if ($dc!='0 G') { |
|
353 | + if ($dc != '0 G') { |
|
354 | 354 | $this->out($dc); |
355 | 355 | } |
356 | 356 | $this->fillColor = $fc; |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | //Restore line width |
367 | 367 | if ($this->lineWidth != $lw) { |
368 | 368 | $this->lineWidth = $lw; |
369 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
369 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
370 | 370 | } |
371 | 371 | //Restore font |
372 | 372 | if ($family) { |
@@ -404,10 +404,10 @@ discard block |
||
404 | 404 | public function setDrawColor($r, $g = null, $b = null) |
405 | 405 | { |
406 | 406 | //Set color for all stroking operations |
407 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
408 | - $this->drawColor = sprintf('%.3F G', $r/255); |
|
407 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
408 | + $this->drawColor = sprintf('%.3F G', $r / 255); |
|
409 | 409 | } else { |
410 | - $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r/255, $g/255, $b/255); |
|
410 | + $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255); |
|
411 | 411 | } |
412 | 412 | if ($this->page > 0) { |
413 | 413 | $this->out($this->drawColor); |
@@ -417,10 +417,10 @@ discard block |
||
417 | 417 | public function setFillColor($r, $g = null, $b = null) |
418 | 418 | { |
419 | 419 | //Set color for all filling operations |
420 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
421 | - $this->fillColor = sprintf('%.3F g', $r/255); |
|
420 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
421 | + $this->fillColor = sprintf('%.3F g', $r / 255); |
|
422 | 422 | } else { |
423 | - $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
423 | + $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
424 | 424 | } |
425 | 425 | $this->colorFlag = ($this->fillColor != $this->textColor); |
426 | 426 | if ($this->page > 0) { |
@@ -431,10 +431,10 @@ discard block |
||
431 | 431 | public function settextColor($r, $g = null, $b = null) |
432 | 432 | { |
433 | 433 | //Set color for text |
434 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
435 | - $this->textColor = sprintf('%.3F g', $r/255); |
|
434 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
435 | + $this->textColor = sprintf('%.3F g', $r / 255); |
|
436 | 436 | } else { |
437 | - $this->textColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
437 | + $this->textColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
438 | 438 | } |
439 | 439 | $this->colorFlag = ($this->fillColor != $this->textColor); |
440 | 440 | } |
@@ -442,14 +442,14 @@ discard block |
||
442 | 442 | public function getStringWidth($s) |
443 | 443 | { |
444 | 444 | //Get width of a string in the current font |
445 | - $s = (string)$s; |
|
446 | - $cw =& $this->currentFont['cw']; |
|
445 | + $s = (string) $s; |
|
446 | + $cw = & $this->currentFont['cw']; |
|
447 | 447 | $w = 0; |
448 | 448 | $l = strlen($s); |
449 | - for ($i=0; $i<$l; $i++) { |
|
449 | + for ($i = 0; $i < $l; $i++) { |
|
450 | 450 | $w += $cw[$s[$i]]; |
451 | 451 | } |
452 | - return $w*$this->fontSize/1000; |
|
452 | + return $w * $this->fontSize / 1000; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | public function setLineWidth($width) |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | //Set line width |
458 | 458 | $this->lineWidth = $width; |
459 | 459 | if ($this->page > 0) { |
460 | - $this->out(sprintf('%.2F w', $width*$this->k)); |
|
460 | + $this->out(sprintf('%.2F w', $width * $this->k)); |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | $this->out( |
468 | 468 | sprintf( |
469 | 469 | '%.2F %.2F m %.2F %.2F l S', |
470 | - $x1*$this->k, |
|
471 | - ($this->h-$y1)*$this->k, |
|
472 | - $x2*$this->k, |
|
473 | - ($this->h-$y2)*$this->k |
|
470 | + $x1 * $this->k, |
|
471 | + ($this->h - $y1) * $this->k, |
|
472 | + $x2 * $this->k, |
|
473 | + ($this->h - $y2) * $this->k |
|
474 | 474 | ) |
475 | 475 | ); |
476 | 476 | } |
@@ -488,10 +488,10 @@ discard block |
||
488 | 488 | $this->out( |
489 | 489 | sprintf( |
490 | 490 | '%.2F %.2F %.2F %.2F re %s', |
491 | - $x*$this->k, |
|
492 | - ($this->h-$y)*$this->k, |
|
493 | - $w*$this->k, |
|
494 | - -$h*$this->k, |
|
491 | + $x * $this->k, |
|
492 | + ($this->h - $y) * $this->k, |
|
493 | + $w * $this->k, |
|
494 | + -$h * $this->k, |
|
495 | 495 | $op |
496 | 496 | ) |
497 | 497 | ); |
@@ -502,24 +502,24 @@ discard block |
||
502 | 502 | //Add a TrueType or Type1 font |
503 | 503 | $family = strtolower($family); |
504 | 504 | if ($file == '') { |
505 | - $file = str_replace(' ', '', $family).strtolower($style).'.php'; |
|
505 | + $file = str_replace(' ', '', $family) . strtolower($style) . '.php'; |
|
506 | 506 | } |
507 | - if ($family=='arial') { |
|
508 | - $family='helvetica'; |
|
507 | + if ($family == 'arial') { |
|
508 | + $family = 'helvetica'; |
|
509 | 509 | } |
510 | 510 | $style = strtoupper($style); |
511 | 511 | if ($style == 'IB') { |
512 | 512 | $style = 'BI'; |
513 | 513 | } |
514 | - $fontkey = $family.$style; |
|
514 | + $fontkey = $family . $style; |
|
515 | 515 | if (isset($this->fonts[$fontkey])) { |
516 | 516 | return; |
517 | 517 | } |
518 | - include $this->getFontPath().$file; |
|
518 | + include $this->getFontPath() . $file; |
|
519 | 519 | if (!isset($name)) { |
520 | 520 | $this->error('Could not include font definition file'); |
521 | 521 | } |
522 | - $i = count($this->fonts)+1; |
|
522 | + $i = count($this->fonts) + 1; |
|
523 | 523 | $this->fonts[$fontkey] = [ |
524 | 524 | 'i'=>$i, |
525 | 525 | 'type'=>$type, |
@@ -535,20 +535,20 @@ discard block |
||
535 | 535 | //Search existing encodings |
536 | 536 | $d = 0; |
537 | 537 | $nb = count($this->diffs); |
538 | - for ($i=1; $i<=$nb; $i++) { |
|
538 | + for ($i = 1; $i <= $nb; $i++) { |
|
539 | 539 | if ($this->diffs[$i] == $diff) { |
540 | 540 | $d = $i; |
541 | 541 | break; |
542 | 542 | } |
543 | 543 | } |
544 | 544 | if ($d == 0) { |
545 | - $d = $nb+1; |
|
545 | + $d = $nb + 1; |
|
546 | 546 | $this->diffs[$d] = $diff; |
547 | 547 | } |
548 | 548 | $this->fonts[$fontkey]['diff'] = $d; |
549 | 549 | } |
550 | 550 | if ($file) { |
551 | - if ($type=='TrueType') { |
|
551 | + if ($type == 'TrueType') { |
|
552 | 552 | $this->fontFiles[$file] = array('length1'=>$originalsize); |
553 | 553 | } else { |
554 | 554 | $this->fontFiles[$file] = array('length1'=>$size1, 'length2'=>$size2); |
@@ -583,39 +583,39 @@ discard block |
||
583 | 583 | $size = $this->fontSizePt; |
584 | 584 | } |
585 | 585 | //Test if font is already selected |
586 | - if ($this->fontFamily==$family && $this->fontStyle==$style && $this->fontSizePt==$size) { |
|
586 | + if ($this->fontFamily == $family && $this->fontStyle == $style && $this->fontSizePt == $size) { |
|
587 | 587 | return; |
588 | 588 | } |
589 | 589 | //Test if used for the first time |
590 | - $fontkey = $family.$style; |
|
590 | + $fontkey = $family . $style; |
|
591 | 591 | if (!isset($this->fonts[$fontkey])) { |
592 | 592 | //Check if one of the standard fonts |
593 | 593 | if (isset($this->coreFonts[$fontkey])) { |
594 | 594 | if (!isset($fpdf_charwidths[$fontkey])) { |
595 | 595 | //Load metric file |
596 | - $file=$family; |
|
597 | - if ($family=='times' || $family=='helvetica') { |
|
596 | + $file = $family; |
|
597 | + if ($family == 'times' || $family == 'helvetica') { |
|
598 | 598 | $file .= strtolower($style); |
599 | 599 | } |
600 | - include $this->getFontPath().$file.'.php'; |
|
600 | + include $this->getFontPath() . $file . '.php'; |
|
601 | 601 | if (!isset($fpdf_charwidths[$fontkey])) { |
602 | 602 | $this->error('Could not include font metric file'); |
603 | 603 | } |
604 | 604 | } |
605 | - $i = count($this->fonts)+1; |
|
605 | + $i = count($this->fonts) + 1; |
|
606 | 606 | $name = $this->coreFonts[$fontkey]; |
607 | 607 | $cw = $fpdf_charwidths[$fontkey]; |
608 | 608 | $this->fonts[$fontkey] = ['i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw]; |
609 | 609 | } else { |
610 | - $this->error('Undefined font: '.$family.' '.$style); |
|
610 | + $this->error('Undefined font: ' . $family . ' ' . $style); |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | //Select it |
614 | 614 | $this->fontFamily = $family; |
615 | 615 | $this->fontStyle = $style; |
616 | 616 | $this->fontSizePt = $size; |
617 | - $this->fontSize = $size/$this->k; |
|
618 | - $this->currentFont =& $this->fonts[$fontkey]; |
|
617 | + $this->fontSize = $size / $this->k; |
|
618 | + $this->currentFont = & $this->fonts[$fontkey]; |
|
619 | 619 | if ($this->page > 0) { |
620 | 620 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
621 | 621 | } |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | return; |
629 | 629 | } |
630 | 630 | $this->fontSizePt = $size; |
631 | - $this->fontSize = $size/$this->k; |
|
631 | + $this->fontSize = $size / $this->k; |
|
632 | 632 | if ($this->page > 0) { |
633 | 633 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
634 | 634 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | public function addlink() |
638 | 638 | { |
639 | 639 | //Create a new internal link |
640 | - $n = count($this->links)+1; |
|
640 | + $n = count($this->links) + 1; |
|
641 | 641 | $this->links[$n] = array(0, 0); |
642 | 642 | return $n; |
643 | 643 | } |
@@ -658,10 +658,10 @@ discard block |
||
658 | 658 | { |
659 | 659 | //Put a link on the page |
660 | 660 | $this->PageLinks[$this->page][] = [ |
661 | - $x*$this->k, |
|
662 | - $this->hPt-$y*$this->k, |
|
663 | - $w*$this->k, |
|
664 | - $h*$this->k, |
|
661 | + $x * $this->k, |
|
662 | + $this->hPt - $y * $this->k, |
|
663 | + $w * $this->k, |
|
664 | + $h * $this->k, |
|
665 | 665 | $link |
666 | 666 | ]; |
667 | 667 | } |
@@ -669,12 +669,12 @@ discard block |
||
669 | 669 | public function text($x, $y, $txt) |
670 | 670 | { |
671 | 671 | //Output a string |
672 | - $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x*$this->k, ($this->h-$y)*$this->k, $this->escape($txt)); |
|
673 | - if ($this->underline && $txt!='') { |
|
674 | - $s .= ' '.$this->doUnderLine($x, $y, $txt); |
|
672 | + $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->escape($txt)); |
|
673 | + if ($this->underline && $txt != '') { |
|
674 | + $s .= ' ' . $this->doUnderLine($x, $y, $txt); |
|
675 | 675 | } |
676 | 676 | if ($this->colorFlag) { |
677 | - $s = 'q '.$this->textColor.' '.$s.' Q'; |
|
677 | + $s = 'q ' . $this->textColor . ' ' . $s . ' Q'; |
|
678 | 678 | } |
679 | 679 | $this->out($s); |
680 | 680 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | { |
690 | 690 | //Output a cell |
691 | 691 | $k = $this->k; |
692 | - if ($this->y+$h > $this->PageBreakTrigger |
|
692 | + if ($this->y + $h > $this->PageBreakTrigger |
|
693 | 693 | && !$this->InHeader |
694 | 694 | && !$this->InFooter |
695 | 695 | && $this->acceptPageBreak() |
@@ -705,77 +705,77 @@ discard block |
||
705 | 705 | $this->x = $x; |
706 | 706 | if ($ws > 0) { |
707 | 707 | $this->ws = $ws; |
708 | - $this->out(sprintf('%.3F Tw', $ws*$k)); |
|
708 | + $this->out(sprintf('%.3F Tw', $ws * $k)); |
|
709 | 709 | } |
710 | 710 | } |
711 | 711 | if ($w == 0) { |
712 | - $w = $this->w-$this->rMargin-$this->x; |
|
712 | + $w = $this->w - $this->rMargin - $this->x; |
|
713 | 713 | } |
714 | - $s=''; |
|
715 | - if ($fill || $border==1) { |
|
714 | + $s = ''; |
|
715 | + if ($fill || $border == 1) { |
|
716 | 716 | if ($fill) { |
717 | - $op=($border==1) ? 'B' : 'f'; |
|
717 | + $op = ($border == 1) ? 'B' : 'f'; |
|
718 | 718 | } else { |
719 | - $op='S'; |
|
719 | + $op = 'S'; |
|
720 | 720 | } |
721 | - $s=sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x*$k, ($this->h-$this->y)*$k, $w*$k, -$h*$k, $op); |
|
721 | + $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op); |
|
722 | 722 | } |
723 | 723 | if (is_string($border)) { |
724 | 724 | $x = $this->x; |
725 | 725 | $y = $this->y; |
726 | 726 | if (strpos($border, 'L') !== false) { |
727 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, $x*$k, ($this->h-($y+$h))*$k); |
|
727 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k); |
|
728 | 728 | } |
729 | 729 | if (strpos($border, 'T') !== false) { |
730 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, ($x+$w)*$k, ($this->h-$y)*$k); |
|
730 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k); |
|
731 | 731 | } |
732 | 732 | if (strpos($border, 'R') !== false) { |
733 | 733 | $s .= sprintf( |
734 | 734 | '%.2F %.2F m %.2F %.2F l S ', |
735 | - ($x+$w)*$k, |
|
736 | - ($this->h-$y)*$k, |
|
737 | - ($x+$w)*$k, |
|
738 | - ($this->h-($y+$h))*$k |
|
735 | + ($x + $w) * $k, |
|
736 | + ($this->h - $y) * $k, |
|
737 | + ($x + $w) * $k, |
|
738 | + ($this->h - ($y + $h)) * $k |
|
739 | 739 | ); |
740 | 740 | } |
741 | 741 | if (strpos($border, 'B') !== false) { |
742 | 742 | $s .= sprintf( |
743 | 743 | '%.2F %.2F m %.2F %.2F l S ', |
744 | - $x*$k, |
|
745 | - ($this->h-($y+$h))*$k, |
|
746 | - ($x+$w)*$k, |
|
747 | - ($this->h-($y+$h))*$k |
|
744 | + $x * $k, |
|
745 | + ($this->h - ($y + $h)) * $k, |
|
746 | + ($x + $w) * $k, |
|
747 | + ($this->h - ($y + $h)) * $k |
|
748 | 748 | ); |
749 | 749 | } |
750 | 750 | } |
751 | 751 | if ($txt !== '') { |
752 | 752 | if ($align == 'R') { |
753 | - $dx = $w-$this->cMargin-$this->getStringWidth($txt); |
|
753 | + $dx = $w - $this->cMargin - $this->getStringWidth($txt); |
|
754 | 754 | } elseif ($align == 'C') { |
755 | - $dx = ($w-$this->getStringWidth($txt))/2; |
|
755 | + $dx = ($w - $this->getStringWidth($txt)) / 2; |
|
756 | 756 | } else { |
757 | 757 | $dx = $this->cMargin; |
758 | 758 | } |
759 | 759 | if ($this->colorFlag) { |
760 | - $s .= 'q '.$this->textColor.' '; |
|
760 | + $s .= 'q ' . $this->textColor . ' '; |
|
761 | 761 | } |
762 | 762 | $txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt))); |
763 | 763 | $s .= sprintf( |
764 | 764 | 'BT %.2F %.2F Td (%s) Tj ET', |
765 | - ($this->x+$dx)*$k, |
|
766 | - ($this->h-($this->y+.5*$h+.3*$this->fontSize))*$k, |
|
765 | + ($this->x + $dx) * $k, |
|
766 | + ($this->h - ($this->y + .5 * $h + .3 * $this->fontSize)) * $k, |
|
767 | 767 | $txt2 |
768 | 768 | ); |
769 | 769 | if ($this->underline) { |
770 | - $s .= ' '.$this->doUnderLine($this->x+$dx, $this->y+.5*$h+.3*$this->fontSize, $txt); |
|
770 | + $s .= ' ' . $this->doUnderLine($this->x + $dx, $this->y + .5 * $h + .3 * $this->fontSize, $txt); |
|
771 | 771 | } |
772 | 772 | if ($this->colorFlag) { |
773 | - $s.=' Q'; |
|
773 | + $s .= ' Q'; |
|
774 | 774 | } |
775 | 775 | if ($link) { |
776 | 776 | $this->link( |
777 | - $this->x+$dx, |
|
778 | - $this->y+.5*$h-.5*$this->fontSize, |
|
777 | + $this->x + $dx, |
|
778 | + $this->y + .5 * $h - .5 * $this->fontSize, |
|
779 | 779 | $this->getStringWidth($txt), |
780 | 780 | $this->fontSize, |
781 | 781 | $link |
@@ -800,14 +800,14 @@ discard block |
||
800 | 800 | public function multicell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) |
801 | 801 | { |
802 | 802 | //Output text with automatic or explicit line breaks |
803 | - $cw =& $this->currentFont['cw']; |
|
803 | + $cw = & $this->currentFont['cw']; |
|
804 | 804 | if ($w == 0) { |
805 | - $w = $this->w-$this->rMargin-$this->x; |
|
805 | + $w = $this->w - $this->rMargin - $this->x; |
|
806 | 806 | } |
807 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
807 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
808 | 808 | $s = str_replace("\r", '', $txt); |
809 | 809 | $nb = strlen($s); |
810 | - if ($nb>0 && $s[$nb-1] == "\n") { |
|
810 | + if ($nb > 0 && $s[$nb - 1] == "\n") { |
|
811 | 811 | $nb--; |
812 | 812 | } |
813 | 813 | $b = 0; |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | if (strpos($border, 'R') !== false) { |
825 | 825 | $b2 .= 'R'; |
826 | 826 | } |
827 | - $b=(strpos($border, 'T') !== false) ? $b2.'T' : $b2; |
|
827 | + $b = (strpos($border, 'T') !== false) ? $b2 . 'T' : $b2; |
|
828 | 828 | } |
829 | 829 | } |
830 | 830 | $sep = -1; |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | $l = 0; |
834 | 834 | $ns = 0; |
835 | 835 | $nl = 1; |
836 | - while ($i<$nb) { |
|
836 | + while ($i < $nb) { |
|
837 | 837 | //Get next character |
838 | 838 | $c = $s[$i]; |
839 | 839 | if ($c == "\n") { |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | $this->ws = 0; |
843 | 843 | $this->out('0 Tw'); |
844 | 844 | } |
845 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
845 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
846 | 846 | $i++; |
847 | 847 | $sep = -1; |
848 | 848 | $j = $i; |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $ns = 0; |
851 | 851 | $nl++; |
852 | 852 | if ($border && $nl == 2) { |
853 | - $b=$b2; |
|
853 | + $b = $b2; |
|
854 | 854 | } |
855 | 855 | continue; |
856 | 856 | } |
@@ -870,14 +870,14 @@ discard block |
||
870 | 870 | $this->ws = 0; |
871 | 871 | $this->out('0 Tw'); |
872 | 872 | } |
873 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
873 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
874 | 874 | } else { |
875 | - if ($align=='J') { |
|
876 | - $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->fontSize/($ns-1) : 0; |
|
877 | - $this->out(sprintf('%.3F Tw', $this->ws*$this->k)); |
|
875 | + if ($align == 'J') { |
|
876 | + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->fontSize / ($ns - 1) : 0; |
|
877 | + $this->out(sprintf('%.3F Tw', $this->ws * $this->k)); |
|
878 | 878 | } |
879 | - $this->cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill); |
|
880 | - $i = $sep+1; |
|
879 | + $this->cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); |
|
880 | + $i = $sep + 1; |
|
881 | 881 | } |
882 | 882 | $sep = -1; |
883 | 883 | $j = $i; |
@@ -896,10 +896,10 @@ discard block |
||
896 | 896 | $this->ws = 0; |
897 | 897 | $this->out('0 Tw'); |
898 | 898 | } |
899 | - if ($border && strpos($border, 'B')!==false) { |
|
899 | + if ($border && strpos($border, 'B') !== false) { |
|
900 | 900 | $b .= 'B'; |
901 | 901 | } |
902 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
902 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
903 | 903 | $this->x = $this->lMargin; |
904 | 904 | } |
905 | 905 | |
@@ -907,9 +907,9 @@ discard block |
||
907 | 907 | public function write($h, $txt, $link = '') |
908 | 908 | { |
909 | 909 | //Output text in flowing mode |
910 | - $cw =& $this->currentFont['cw']; |
|
911 | - $w = $this->w-$this->rMargin-$this->x; |
|
912 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
910 | + $cw = & $this->currentFont['cw']; |
|
911 | + $w = $this->w - $this->rMargin - $this->x; |
|
912 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
913 | 913 | $s = str_replace("\r", '', $txt); |
914 | 914 | $nb = strlen($s); |
915 | 915 | $sep = -1; |
@@ -919,18 +919,18 @@ discard block |
||
919 | 919 | $nl = 1; |
920 | 920 | while ($i < $nb) { |
921 | 921 | //Get next character |
922 | - $c=$s[$i]; |
|
923 | - if ($c=="\n") { |
|
922 | + $c = $s[$i]; |
|
923 | + if ($c == "\n") { |
|
924 | 924 | //Explicit line break |
925 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
925 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
926 | 926 | $i++; |
927 | 927 | $sep = -1; |
928 | 928 | $j = $i; |
929 | 929 | $l = 0; |
930 | 930 | if ($nl == 1) { |
931 | 931 | $this->x = $this->lMargin; |
932 | - $w = $this->w-$this->rMargin-$this->x; |
|
933 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
932 | + $w = $this->w - $this->rMargin - $this->x; |
|
933 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
934 | 934 | } |
935 | 935 | $nl++; |
936 | 936 | continue; |
@@ -946,8 +946,8 @@ discard block |
||
946 | 946 | //Move to next line |
947 | 947 | $this->x = $this->lMargin; |
948 | 948 | $this->y += $h; |
949 | - $w = $this->w-$this->rMargin-$this->x; |
|
950 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
949 | + $w = $this->w - $this->rMargin - $this->x; |
|
950 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
951 | 951 | $i++; |
952 | 952 | $nl++; |
953 | 953 | continue; |
@@ -955,18 +955,18 @@ discard block |
||
955 | 955 | if ($i == $j) { |
956 | 956 | $i++; |
957 | 957 | } |
958 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
958 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
959 | 959 | } else { |
960 | - $this->cell($w, $h, substr($s, $j, $sep-$j), 0, 2, '', 0, $link); |
|
961 | - $i = $sep+1; |
|
960 | + $this->cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); |
|
961 | + $i = $sep + 1; |
|
962 | 962 | } |
963 | 963 | $sep = -1; |
964 | 964 | $j = $i; |
965 | 965 | $l = 0; |
966 | 966 | if ($nl == 1) { |
967 | 967 | $this->x = $this->lMargin; |
968 | - $w = $this->w-$this->rMargin-$this->x; |
|
969 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
968 | + $w = $this->w - $this->rMargin - $this->x; |
|
969 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
970 | 970 | } |
971 | 971 | $nl++; |
972 | 972 | } else { |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | } |
976 | 976 | //Last chunk |
977 | 977 | if ($i != $j) { |
978 | - $this->cell($l/1000*$this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
978 | + $this->cell($l / 1000 * $this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
979 | 979 | } |
980 | 980 | } |
981 | 981 | |
@@ -998,20 +998,20 @@ discard block |
||
998 | 998 | if ($type == '') { |
999 | 999 | $pos = strrpos($file, '.'); |
1000 | 1000 | if (!$pos) { |
1001 | - $this->error('Image file has no extension and no type was specified: '.$file); |
|
1001 | + $this->error('Image file has no extension and no type was specified: ' . $file); |
|
1002 | 1002 | } |
1003 | - $type = substr($file, $pos+1); |
|
1003 | + $type = substr($file, $pos + 1); |
|
1004 | 1004 | } |
1005 | 1005 | $type = strtolower($type); |
1006 | 1006 | if ($type == 'jpeg') { |
1007 | 1007 | $type = 'jpg'; |
1008 | 1008 | } |
1009 | - $mtd = 'parse'.strtoupper($type); |
|
1009 | + $mtd = 'parse' . strtoupper($type); |
|
1010 | 1010 | if (!method_exists($this, $mtd)) { |
1011 | - $this->error('Unsupported image type: '.$type); |
|
1011 | + $this->error('Unsupported image type: ' . $type); |
|
1012 | 1012 | } |
1013 | 1013 | $info = $this->$mtd($file); |
1014 | - $info['i'] = count($this->images)+1; |
|
1014 | + $info['i'] = count($this->images) + 1; |
|
1015 | 1015 | $this->images[$file] = $info; |
1016 | 1016 | } else { |
1017 | 1017 | $info = $this->images[$file]; |
@@ -1019,16 +1019,16 @@ discard block |
||
1019 | 1019 | //Automatic width and height calculation if needed |
1020 | 1020 | if ($w == 0 && $h == 0) { |
1021 | 1021 | //Put image at 72 dpi |
1022 | - $w = $info['w']/$this->k; |
|
1023 | - $h = $info['h']/$this->k; |
|
1022 | + $w = $info['w'] / $this->k; |
|
1023 | + $h = $info['h'] / $this->k; |
|
1024 | 1024 | } elseif ($w == 0) { |
1025 | - $w = $h*$info['w']/$info['h']; |
|
1025 | + $w = $h * $info['w'] / $info['h']; |
|
1026 | 1026 | } elseif ($h == 0) { |
1027 | - $h = $w*$info['h']/$info['w']; |
|
1027 | + $h = $w * $info['h'] / $info['w']; |
|
1028 | 1028 | } |
1029 | 1029 | //Flowing mode |
1030 | 1030 | if ($y === null) { |
1031 | - if ($this->y+$h > $this->pageBreakTrigger |
|
1031 | + if ($this->y + $h > $this->pageBreakTrigger |
|
1032 | 1032 | && !$this->inHeader |
1033 | 1033 | && !$this->inFooter |
1034 | 1034 | && $this->acceptPageBreak() |
@@ -1047,10 +1047,10 @@ discard block |
||
1047 | 1047 | $this->out( |
1048 | 1048 | sprintf( |
1049 | 1049 | 'q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', |
1050 | - $w*$this->k, |
|
1051 | - $h*$this->k, |
|
1052 | - $x*$this->k, |
|
1053 | - ($this->h-($y+$h))*$this->k, |
|
1050 | + $w * $this->k, |
|
1051 | + $h * $this->k, |
|
1052 | + $x * $this->k, |
|
1053 | + ($this->h - ($y + $h)) * $this->k, |
|
1054 | 1054 | $info['i'] |
1055 | 1055 | ) |
1056 | 1056 | ); |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | if ($x >= 0) { |
1074 | 1074 | $this->x = $x; |
1075 | 1075 | } else { |
1076 | - $this->x = $this->w+$x; |
|
1076 | + $this->x = $this->w + $x; |
|
1077 | 1077 | } |
1078 | 1078 | } |
1079 | 1079 | |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | if ($y >= 0) { |
1093 | 1093 | $this->y = $y; |
1094 | 1094 | } else { |
1095 | - $this->y = $this->h+$y; |
|
1095 | + $this->y = $this->h + $y; |
|
1096 | 1096 | } |
1097 | 1097 | } |
1098 | 1098 | |
@@ -1139,8 +1139,8 @@ discard block |
||
1139 | 1139 | if (headers_sent()) { |
1140 | 1140 | $this->error('Some data has already been output, can\'t send PDF file'); |
1141 | 1141 | } |
1142 | - header('Content-Length: '.strlen($this->buffer)); |
|
1143 | - header('Content-Disposition: inline; filename="'.$name.'"'); |
|
1142 | + header('Content-Length: ' . strlen($this->buffer)); |
|
1143 | + header('Content-Disposition: inline; filename="' . $name . '"'); |
|
1144 | 1144 | header('Cache-Control: private, max-age=0, must-revalidate'); |
1145 | 1145 | header('Pragma: public'); |
1146 | 1146 | ini_set('zlib.output_compression', '0'); |
@@ -1156,8 +1156,8 @@ discard block |
||
1156 | 1156 | if (headers_sent()) { |
1157 | 1157 | $this->error('Some data has already been output, can\'t send PDF file'); |
1158 | 1158 | } |
1159 | - header('Content-Length: '.strlen($this->buffer)); |
|
1160 | - header('Content-Disposition: attachment; filename="'.$name.'"'); |
|
1159 | + header('Content-Length: ' . strlen($this->buffer)); |
|
1160 | + header('Content-Disposition: attachment; filename="' . $name . '"'); |
|
1161 | 1161 | header('Cache-Control: private, max-age=0, must-revalidate'); |
1162 | 1162 | header('Pragma: public'); |
1163 | 1163 | ini_set('zlib.output_compression', '0'); |
@@ -1165,9 +1165,9 @@ discard block |
||
1165 | 1165 | break; |
1166 | 1166 | case 'F': |
1167 | 1167 | //Save to local file |
1168 | - $f=fopen($name, 'wb'); |
|
1168 | + $f = fopen($name, 'wb'); |
|
1169 | 1169 | if (!$f) { |
1170 | - $this->error('Unable to create output file: '.$name); |
|
1170 | + $this->error('Unable to create output file: ' . $name); |
|
1171 | 1171 | } |
1172 | 1172 | fwrite($f, $this->buffer, strlen($this->buffer)); |
1173 | 1173 | fclose($f); |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | //Return as a string |
1177 | 1177 | return $this->buffer; |
1178 | 1178 | default: |
1179 | - $this->error('Incorrect output destination: '.$dest); |
|
1179 | + $this->error('Incorrect output destination: ' . $dest); |
|
1180 | 1180 | } |
1181 | 1181 | return ''; |
1182 | 1182 | } |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | protected function dochecks() |
1186 | 1186 | { |
1187 | 1187 | //Check availability of %F |
1188 | - if (sprintf('%.1F', 1.0)!='1.0') { |
|
1188 | + if (sprintf('%.1F', 1.0) != '1.0') { |
|
1189 | 1189 | $this->error('This version of PHP is not supported'); |
1190 | 1190 | } |
1191 | 1191 | //Check mbstring overloading |
@@ -1197,19 +1197,19 @@ discard block |
||
1197 | 1197 | |
1198 | 1198 | protected function getpageformat($format) |
1199 | 1199 | { |
1200 | - $format=strtolower($format); |
|
1200 | + $format = strtolower($format); |
|
1201 | 1201 | if (!isset($this->pageFormats[$format])) { |
1202 | - $this->error('Unknown page format: '.$format); |
|
1202 | + $this->error('Unknown page format: ' . $format); |
|
1203 | 1203 | } |
1204 | - $a=$this->pageFormats[$format]; |
|
1205 | - return array($a[0]/$this->k, $a[1]/$this->k); |
|
1204 | + $a = $this->pageFormats[$format]; |
|
1205 | + return array($a[0] / $this->k, $a[1] / $this->k); |
|
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | |
1209 | 1209 | protected function getFontPath() |
1210 | 1210 | { |
1211 | - if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) { |
|
1212 | - define('FPDF_FONTPATH', dirname(__FILE__).'/font/'); |
|
1211 | + if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__) . '/font')) { |
|
1212 | + define('FPDF_FONTPATH', dirname(__FILE__) . '/font/'); |
|
1213 | 1213 | } |
1214 | 1214 | return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; |
1215 | 1215 | } |
@@ -1233,12 +1233,12 @@ discard block |
||
1233 | 1233 | $format = $this->defPageFormat; |
1234 | 1234 | } else { |
1235 | 1235 | if (is_string($format)) { |
1236 | - $format=$this->getpageformat($format); |
|
1236 | + $format = $this->getpageformat($format); |
|
1237 | 1237 | } |
1238 | 1238 | } |
1239 | 1239 | if ($orientation != $this->curOrientation |
1240 | - || $format[0]!=$this->curPageFormat[0] |
|
1241 | - || $format[1]!=$this->curPageFormat[1] |
|
1240 | + || $format[0] != $this->curPageFormat[0] |
|
1241 | + || $format[1] != $this->curPageFormat[1] |
|
1242 | 1242 | ) { |
1243 | 1243 | //New size |
1244 | 1244 | if ($orientation == 'P') { |
@@ -1248,9 +1248,9 @@ discard block |
||
1248 | 1248 | $this->w = $format[1]; |
1249 | 1249 | $this->h = $format[0]; |
1250 | 1250 | } |
1251 | - $this->wPt = $this->w*$this->k; |
|
1252 | - $this->hPt = $this->h*$this->k; |
|
1253 | - $this->pageBreakTrigger = $this->h-$this->bMargin; |
|
1251 | + $this->wPt = $this->w * $this->k; |
|
1252 | + $this->hPt = $this->h * $this->k; |
|
1253 | + $this->pageBreakTrigger = $this->h - $this->bMargin; |
|
1254 | 1254 | $this->curOrientation = $orientation; |
1255 | 1255 | $this->curPageFormat = $format; |
1256 | 1256 | } |
@@ -1283,7 +1283,7 @@ discard block |
||
1283 | 1283 | protected function textString($s) |
1284 | 1284 | { |
1285 | 1285 | //Format a text string |
1286 | - return '('.$this->escape($s).')'; |
|
1286 | + return '(' . $this->escape($s) . ')'; |
|
1287 | 1287 | } |
1288 | 1288 | |
1289 | 1289 | |
@@ -1299,16 +1299,16 @@ discard block |
||
1299 | 1299 | //3-byte character |
1300 | 1300 | $c2 = ord($s[$i++]); |
1301 | 1301 | $c3 = ord($s[$i++]); |
1302 | - $res .= chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); |
|
1303 | - $res .= chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); |
|
1302 | + $res .= chr((($c1 & 0x0F) << 4) + (($c2 & 0x3C) >> 2)); |
|
1303 | + $res .= chr((($c2 & 0x03) << 6) + ($c3 & 0x3F)); |
|
1304 | 1304 | } elseif ($c1 >= 192) { |
1305 | 1305 | //2-byte character |
1306 | 1306 | $c2 = ord($s[$i++]); |
1307 | - $res .= chr(($c1 & 0x1C)>>2); |
|
1308 | - $res .= chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); |
|
1307 | + $res .= chr(($c1 & 0x1C) >> 2); |
|
1308 | + $res .= chr((($c1 & 0x03) << 6) + ($c2 & 0x3F)); |
|
1309 | 1309 | } else { |
1310 | 1310 | //Single-byte character |
1311 | - $res .= "\0".chr($c1); |
|
1311 | + $res .= "\0" . chr($c1); |
|
1312 | 1312 | } |
1313 | 1313 | } |
1314 | 1314 | return $res; |
@@ -1320,13 +1320,13 @@ discard block |
||
1320 | 1320 | //Underline text |
1321 | 1321 | $up = $this->currentFont['up']; |
1322 | 1322 | $ut = $this->currentFont['ut']; |
1323 | - $w = $this->getStringWidth($txt)+$this->ws*substr_count($txt, ' '); |
|
1323 | + $w = $this->getStringWidth($txt) + $this->ws * substr_count($txt, ' '); |
|
1324 | 1324 | return sprintf( |
1325 | 1325 | '%.2F %.2F %.2F %.2F re f', |
1326 | - $x*$this->k, |
|
1327 | - ($this->h-($y-$up/1000*$this->fontSize))*$this->k, |
|
1328 | - $w*$this->k, |
|
1329 | - -$ut/1000*$this->fontSizePt |
|
1326 | + $x * $this->k, |
|
1327 | + ($this->h - ($y - $up / 1000 * $this->fontSize)) * $this->k, |
|
1328 | + $w * $this->k, |
|
1329 | + -$ut / 1000 * $this->fontSizePt |
|
1330 | 1330 | ); |
1331 | 1331 | } |
1332 | 1332 | |
@@ -1336,17 +1336,17 @@ discard block |
||
1336 | 1336 | //Extract info from a JPEG file |
1337 | 1337 | $a = getImageSize($file); |
1338 | 1338 | if (!$a) { |
1339 | - $this->error('Missing or incorrect image file: '.$file); |
|
1339 | + $this->error('Missing or incorrect image file: ' . $file); |
|
1340 | 1340 | } |
1341 | - if ($a[2]!=2) { |
|
1342 | - $this->error('Not a JPEG file: '.$file); |
|
1341 | + if ($a[2] != 2) { |
|
1342 | + $this->error('Not a JPEG file: ' . $file); |
|
1343 | 1343 | } |
1344 | 1344 | if (!isset($a['channels']) || $a['channels'] == 3) { |
1345 | 1345 | $colspace = 'DeviceRGB'; |
1346 | 1346 | } elseif ($a['channels'] == 4) { |
1347 | 1347 | $colspace = 'DeviceCMYK'; |
1348 | 1348 | } else { |
1349 | - $colspace='DeviceGray'; |
|
1349 | + $colspace = 'DeviceGray'; |
|
1350 | 1350 | } |
1351 | 1351 | $bpc = isset($a['bits']) ? $a['bits'] : 8; |
1352 | 1352 | //Read whole file |
@@ -1365,22 +1365,22 @@ discard block |
||
1365 | 1365 | //Extract info from a PNG file |
1366 | 1366 | $f = fopen($file, 'rb'); |
1367 | 1367 | if (!$f) { |
1368 | - $this->error('Can\'t open image file: '.$file); |
|
1368 | + $this->error('Can\'t open image file: ' . $file); |
|
1369 | 1369 | } |
1370 | 1370 | //Check signature |
1371 | - if ($this->readstream($f, 8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { |
|
1372 | - $this->error('Not a PNG file: '.$file); |
|
1371 | + if ($this->readstream($f, 8) != chr(137) . 'PNG' . chr(13) . chr(10) . chr(26) . chr(10)) { |
|
1372 | + $this->error('Not a PNG file: ' . $file); |
|
1373 | 1373 | } |
1374 | 1374 | //Read header chunk |
1375 | 1375 | $this->readstream($f, 4); |
1376 | - if ($this->readstream($f, 4)!='IHDR') { |
|
1377 | - $this->error('Incorrect PNG file: '.$file); |
|
1376 | + if ($this->readstream($f, 4) != 'IHDR') { |
|
1377 | + $this->error('Incorrect PNG file: ' . $file); |
|
1378 | 1378 | } |
1379 | 1379 | $w = $this->readint($f); |
1380 | 1380 | $h = $this->readint($f); |
1381 | 1381 | $bpc = ord($this->readstream($f, 1)); |
1382 | - if ($bpc>8) { |
|
1383 | - $this->error('16-bit depth not supported: '.$file); |
|
1382 | + if ($bpc > 8) { |
|
1383 | + $this->error('16-bit depth not supported: ' . $file); |
|
1384 | 1384 | } |
1385 | 1385 | $ct = ord($this->readstream($f, 1)); |
1386 | 1386 | if ($ct == 0) { |
@@ -1390,20 +1390,20 @@ discard block |
||
1390 | 1390 | } elseif ($ct == 3) { |
1391 | 1391 | $colspace = 'Indexed'; |
1392 | 1392 | } else { |
1393 | - $this->error('Alpha channel not supported: '.$file); |
|
1393 | + $this->error('Alpha channel not supported: ' . $file); |
|
1394 | 1394 | } |
1395 | 1395 | if (ord($this->readstream($f, 1)) != 0) { |
1396 | - $this->error('Unknown compression method: '.$file); |
|
1396 | + $this->error('Unknown compression method: ' . $file); |
|
1397 | 1397 | } |
1398 | 1398 | if (ord($this->readstream($f, 1)) != 0) { |
1399 | - $this->error('Unknown filter method: '.$file); |
|
1399 | + $this->error('Unknown filter method: ' . $file); |
|
1400 | 1400 | } |
1401 | 1401 | if (ord($this->readstream($f, 1)) != 0) { |
1402 | - $this->error('Interlacing not supported: '.$file); |
|
1402 | + $this->error('Interlacing not supported: ' . $file); |
|
1403 | 1403 | } |
1404 | 1404 | $this->readstream($f, 4); |
1405 | 1405 | $parms = '/DecodeParms <</Predictor 15 /Colors ' |
1406 | - . ($ct==2 ? 3 : 1) |
|
1406 | + . ($ct == 2 ? 3 : 1) |
|
1407 | 1407 | . ' /BitsPerComponent ' |
1408 | 1408 | . $bpc |
1409 | 1409 | . ' /Columns ' |
@@ -1441,11 +1441,11 @@ discard block |
||
1441 | 1441 | } elseif ($type == 'IEND') { |
1442 | 1442 | break; |
1443 | 1443 | } else { |
1444 | - $this->readstream($f, $n+4); |
|
1444 | + $this->readstream($f, $n + 4); |
|
1445 | 1445 | } |
1446 | 1446 | } while ($n); |
1447 | 1447 | if ($colspace == 'Indexed' && empty($pal)) { |
1448 | - $this->error('Missing palette in '.$file); |
|
1448 | + $this->error('Missing palette in ' . $file); |
|
1449 | 1449 | } |
1450 | 1450 | fclose($f); |
1451 | 1451 | return [ |
@@ -1465,9 +1465,9 @@ discard block |
||
1465 | 1465 | protected function readstream($f, $n) |
1466 | 1466 | { |
1467 | 1467 | //Read n bytes from stream |
1468 | - $res=''; |
|
1468 | + $res = ''; |
|
1469 | 1469 | while ($n > 0 && !feof($f)) { |
1470 | - $s=fread($f, $n); |
|
1470 | + $s = fread($f, $n); |
|
1471 | 1471 | if ($s === false) { |
1472 | 1472 | $this->error('Error while reading stream'); |
1473 | 1473 | } |
@@ -1500,7 +1500,7 @@ discard block |
||
1500 | 1500 | } |
1501 | 1501 | $im = imagecreatefromgif($file); |
1502 | 1502 | if (!$im) { |
1503 | - $this->error('Missing or incorrect image file: '.$file); |
|
1503 | + $this->error('Missing or incorrect image file: ' . $file); |
|
1504 | 1504 | } |
1505 | 1505 | imageinterlace($im, 0); |
1506 | 1506 | $tmp = tempnam('.', 'gif'); |
@@ -1511,7 +1511,7 @@ discard block |
||
1511 | 1511 | $this->error('Error while saving to temporary file'); |
1512 | 1512 | } |
1513 | 1513 | imagedestroy($im); |
1514 | - $info=$this->parsePNG($tmp); |
|
1514 | + $info = $this->parsePNG($tmp); |
|
1515 | 1515 | unlink($tmp); |
1516 | 1516 | return $info; |
1517 | 1517 | } |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | //Begin a new object |
1523 | 1523 | $this->n++; |
1524 | 1524 | $this->offsets[$this->n] = strlen($this->buffer); |
1525 | - $this->out($this->n.' 0 obj'); |
|
1525 | + $this->out($this->n . ' 0 obj'); |
|
1526 | 1526 | } |
1527 | 1527 | |
1528 | 1528 | |
@@ -1538,9 +1538,9 @@ discard block |
||
1538 | 1538 | { |
1539 | 1539 | //Add a line to the document |
1540 | 1540 | if ($this->state == 2) { |
1541 | - $this->pages[$this->page].=$s."\n"; |
|
1541 | + $this->pages[$this->page] .= $s . "\n"; |
|
1542 | 1542 | } else { |
1543 | - $this->buffer .= $s."\n"; |
|
1543 | + $this->buffer .= $s . "\n"; |
|
1544 | 1544 | } |
1545 | 1545 | } |
1546 | 1546 | |
@@ -1550,19 +1550,19 @@ discard block |
||
1550 | 1550 | $nb = $this->page; |
1551 | 1551 | if (!empty($this->aliasNbPages)) { |
1552 | 1552 | //Replace number of pages |
1553 | - for ($n=1; $n<=$nb; $n++) { |
|
1553 | + for ($n = 1; $n <= $nb; $n++) { |
|
1554 | 1554 | $this->pages[$n] = str_replace($this->aliasNbPages, $nb, $this->pages[$n]); |
1555 | 1555 | } |
1556 | 1556 | } |
1557 | 1557 | if ($this->defOrientation == 'P') { |
1558 | - $wPt = $this->defPageFormat[0]*$this->k; |
|
1559 | - $hPt = $this->defPageFormat[1]*$this->k; |
|
1558 | + $wPt = $this->defPageFormat[0] * $this->k; |
|
1559 | + $hPt = $this->defPageFormat[1] * $this->k; |
|
1560 | 1560 | } else { |
1561 | - $wPt = $this->defPageFormat[1]*$this->k; |
|
1562 | - $hPt = $this->defPageFormat[0]*$this->k; |
|
1561 | + $wPt = $this->defPageFormat[1] * $this->k; |
|
1562 | + $hPt = $this->defPageFormat[0] * $this->k; |
|
1563 | 1563 | } |
1564 | 1564 | $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; |
1565 | - for ($n=1; $n<=$nb; $n++) { |
|
1565 | + for ($n = 1; $n <= $nb; $n++) { |
|
1566 | 1566 | //Page |
1567 | 1567 | $this->newObj(); |
1568 | 1568 | $this->out('<</Type /Page'); |
@@ -1575,37 +1575,37 @@ discard block |
||
1575 | 1575 | //Links |
1576 | 1576 | $annots = '/Annots ['; |
1577 | 1577 | foreach ($this->PageLinks[$n] as $pl) { |
1578 | - $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0]+$pl[2], $pl[1]-$pl[3]); |
|
1579 | - $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] '; |
|
1578 | + $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]); |
|
1579 | + $annots .= '<</Type /Annot /Subtype /Link /Rect [' . $rect . '] /Border [0 0 0] '; |
|
1580 | 1580 | if (is_string($pl[4])) { |
1581 | - $annots .= '/A <</S /URI /URI '.$this->textString($pl[4]).'>>>>'; |
|
1581 | + $annots .= '/A <</S /URI /URI ' . $this->textString($pl[4]) . '>>>>'; |
|
1582 | 1582 | } else { |
1583 | 1583 | $l = $this->links[$pl[4]]; |
1584 | 1584 | $h = isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt; |
1585 | - $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1+2*$l[0], $h-$l[1]*$this->k); |
|
1585 | + $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1 + 2 * $l[0], $h - $l[1] * $this->k); |
|
1586 | 1586 | } |
1587 | 1587 | } |
1588 | - $this->out($annots.']'); |
|
1588 | + $this->out($annots . ']'); |
|
1589 | 1589 | } |
1590 | - $this->out('/Contents '.($this->n+1).' 0 R>>'); |
|
1590 | + $this->out('/Contents ' . ($this->n + 1) . ' 0 R>>'); |
|
1591 | 1591 | $this->out('endobj'); |
1592 | 1592 | //Page content |
1593 | - $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
1593 | + $p = ($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
1594 | 1594 | $this->newObj(); |
1595 | - $this->out('<<'.$filter.'/Length '.strlen($p).'>>'); |
|
1595 | + $this->out('<<' . $filter . '/Length ' . strlen($p) . '>>'); |
|
1596 | 1596 | $this->putStream($p); |
1597 | 1597 | $this->out('endobj'); |
1598 | 1598 | } |
1599 | 1599 | //Pages root |
1600 | - $this->offsets[1]=strlen($this->buffer); |
|
1600 | + $this->offsets[1] = strlen($this->buffer); |
|
1601 | 1601 | $this->out('1 0 obj'); |
1602 | 1602 | $this->out('<</Type /Pages'); |
1603 | 1603 | $kids = '/Kids ['; |
1604 | - for ($i=0; $i<$nb; $i++) { |
|
1605 | - $kids .= (3+2*$i).' 0 R '; |
|
1604 | + for ($i = 0; $i < $nb; $i++) { |
|
1605 | + $kids .= (3 + 2 * $i) . ' 0 R '; |
|
1606 | 1606 | } |
1607 | - $this->out($kids.']'); |
|
1608 | - $this->out('/Count '.$nb); |
|
1607 | + $this->out($kids . ']'); |
|
1608 | + $this->out('/Count ' . $nb); |
|
1609 | 1609 | $this->out(sprintf('/MediaBox [0 0 %.2F %.2F]', $wPt, $hPt)); |
1610 | 1610 | $this->out('>>'); |
1611 | 1611 | $this->out('endobj'); |
@@ -1618,41 +1618,41 @@ discard block |
||
1618 | 1618 | foreach ($this->diffs as $diff) { |
1619 | 1619 | //Encodings |
1620 | 1620 | $this->newObj(); |
1621 | - $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); |
|
1621 | + $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>'); |
|
1622 | 1622 | $this->out('endobj'); |
1623 | 1623 | } |
1624 | 1624 | foreach ($this->fontFiles as $file => $info) { |
1625 | 1625 | //Font file embedding |
1626 | 1626 | $this->newObj(); |
1627 | - $this->fontFiles[$file]['n']=$this->n; |
|
1628 | - $font=''; |
|
1629 | - $f = fopen($this->getFontPath().$file, 'rb', 1); |
|
1627 | + $this->fontFiles[$file]['n'] = $this->n; |
|
1628 | + $font = ''; |
|
1629 | + $f = fopen($this->getFontPath() . $file, 'rb', 1); |
|
1630 | 1630 | if (!$f) { |
1631 | 1631 | $this->error('Font file not found'); |
1632 | 1632 | } |
1633 | 1633 | while (!feof($f)) { |
1634 | - $font.=fread($f, 8192); |
|
1634 | + $font .= fread($f, 8192); |
|
1635 | 1635 | } |
1636 | 1636 | fclose($f); |
1637 | - $compressed = (substr($file, -2)=='.z'); |
|
1637 | + $compressed = (substr($file, -2) == '.z'); |
|
1638 | 1638 | if (!$compressed && isset($info['length2'])) { |
1639 | - $header = (ord($font[0])==128); |
|
1639 | + $header = (ord($font[0]) == 128); |
|
1640 | 1640 | if ($header) { |
1641 | 1641 | //Strip first binary header |
1642 | 1642 | $font = substr($font, 6); |
1643 | 1643 | } |
1644 | 1644 | if ($header && ord($font[$info['length1']]) == 128) { |
1645 | 1645 | //Strip second binary header |
1646 | - $font = substr($font, 0, $info['length1']).substr($font, $info['length1']+6); |
|
1646 | + $font = substr($font, 0, $info['length1']) . substr($font, $info['length1'] + 6); |
|
1647 | 1647 | } |
1648 | 1648 | } |
1649 | - $this->out('<</Length '.strlen($font)); |
|
1649 | + $this->out('<</Length ' . strlen($font)); |
|
1650 | 1650 | if ($compressed) { |
1651 | 1651 | $this->out('/Filter /FlateDecode'); |
1652 | 1652 | } |
1653 | - $this->out('/Length1 '.$info['length1']); |
|
1653 | + $this->out('/Length1 ' . $info['length1']); |
|
1654 | 1654 | if (isset($info['length2'])) { |
1655 | - $this->out('/Length2 '.$info['length2'].' /Length3 0'); |
|
1655 | + $this->out('/Length2 ' . $info['length2'] . ' /Length3 0'); |
|
1656 | 1656 | } |
1657 | 1657 | $this->out('>>'); |
1658 | 1658 | $this->putStream($font); |
@@ -1660,32 +1660,32 @@ discard block |
||
1660 | 1660 | } |
1661 | 1661 | foreach ($this->fonts as $k => $font) { |
1662 | 1662 | //Font objects |
1663 | - $this->fonts[$k]['n']=$this->n+1; |
|
1663 | + $this->fonts[$k]['n'] = $this->n + 1; |
|
1664 | 1664 | $type = $font['type']; |
1665 | 1665 | $name = $font['name']; |
1666 | 1666 | if ($type == 'core') { |
1667 | 1667 | //Standard font |
1668 | 1668 | $this->newObj(); |
1669 | 1669 | $this->out('<</Type /Font'); |
1670 | - $this->out('/BaseFont /'.$name); |
|
1670 | + $this->out('/BaseFont /' . $name); |
|
1671 | 1671 | $this->out('/Subtype /Type1'); |
1672 | 1672 | if ($name != 'Symbol' && $name != 'ZapfDingbats') { |
1673 | 1673 | $this->out('/Encoding /WinAnsiEncoding'); |
1674 | 1674 | } |
1675 | 1675 | $this->out('>>'); |
1676 | 1676 | $this->out('endobj'); |
1677 | - } elseif ($type=='Type1' || $type=='TrueType') { |
|
1677 | + } elseif ($type == 'Type1' || $type == 'TrueType') { |
|
1678 | 1678 | //Additional Type1 or TrueType font |
1679 | 1679 | $this->newObj(); |
1680 | 1680 | $this->out('<</Type /Font'); |
1681 | - $this->out('/BaseFont /'.$name); |
|
1682 | - $this->out('/Subtype /'.$type); |
|
1681 | + $this->out('/BaseFont /' . $name); |
|
1682 | + $this->out('/Subtype /' . $type); |
|
1683 | 1683 | $this->out('/FirstChar 32 /LastChar 255'); |
1684 | - $this->out('/Widths '.($this->n+1).' 0 R'); |
|
1685 | - $this->out('/FontDescriptor '.($this->n+2).' 0 R'); |
|
1684 | + $this->out('/Widths ' . ($this->n + 1) . ' 0 R'); |
|
1685 | + $this->out('/FontDescriptor ' . ($this->n + 2) . ' 0 R'); |
|
1686 | 1686 | if ($font['enc']) { |
1687 | 1687 | if (isset($font['diff'])) { |
1688 | - $this->out('/Encoding '.($nf+$font['diff']).' 0 R'); |
|
1688 | + $this->out('/Encoding ' . ($nf + $font['diff']) . ' 0 R'); |
|
1689 | 1689 | } else { |
1690 | 1690 | $this->out('/Encoding /WinAnsiEncoding'); |
1691 | 1691 | } |
@@ -1694,30 +1694,30 @@ discard block |
||
1694 | 1694 | $this->out('endobj'); |
1695 | 1695 | //Widths |
1696 | 1696 | $this->newObj(); |
1697 | - $cw =& $font['cw']; |
|
1697 | + $cw = & $font['cw']; |
|
1698 | 1698 | $s = '['; |
1699 | - for ($i=32; $i<=255; $i++) { |
|
1700 | - $s .= $cw[chr($i)].' '; |
|
1699 | + for ($i = 32; $i <= 255; $i++) { |
|
1700 | + $s .= $cw[chr($i)] . ' '; |
|
1701 | 1701 | } |
1702 | - $this->out($s.']'); |
|
1702 | + $this->out($s . ']'); |
|
1703 | 1703 | $this->out('endobj'); |
1704 | 1704 | //Descriptor |
1705 | 1705 | $this->newObj(); |
1706 | - $s='<</Type /FontDescriptor /FontName /'.$name; |
|
1706 | + $s = '<</Type /FontDescriptor /FontName /' . $name; |
|
1707 | 1707 | foreach ($font['desc'] as $k => $v) { |
1708 | - $s .= ' /'.$k.' '.$v; |
|
1708 | + $s .= ' /' . $k . ' ' . $v; |
|
1709 | 1709 | } |
1710 | - $file=$font['file']; |
|
1710 | + $file = $font['file']; |
|
1711 | 1711 | if ($file) { |
1712 | - $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->fontFiles[$file]['n'].' 0 R'; |
|
1712 | + $s .= ' /FontFile' . ($type == 'Type1' ? '' : '2') . ' ' . $this->fontFiles[$file]['n'] . ' 0 R'; |
|
1713 | 1713 | } |
1714 | - $this->out($s.'>>'); |
|
1714 | + $this->out($s . '>>'); |
|
1715 | 1715 | $this->out('endobj'); |
1716 | 1716 | } else { |
1717 | 1717 | //Allow for additional types |
1718 | - $mtd='_put'.strtolower($type); |
|
1718 | + $mtd = '_put' . strtolower($type); |
|
1719 | 1719 | if (!method_exists($this, $mtd)) { |
1720 | - $this->error('Unsupported font type: '.$type); |
|
1720 | + $this->error('Unsupported font type: ' . $type); |
|
1721 | 1721 | } |
1722 | 1722 | $this->$mtd($font); |
1723 | 1723 | } |
@@ -1735,39 +1735,39 @@ discard block |
||
1735 | 1735 | $this->images[$file]['n'] = $this->n; |
1736 | 1736 | $this->out('<</Type /XObject'); |
1737 | 1737 | $this->out('/Subtype /Image'); |
1738 | - $this->out('/Width '.$info['w']); |
|
1739 | - $this->out('/Height '.$info['h']); |
|
1740 | - if ($info['cs']=='Indexed') { |
|
1741 | - $this->out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); |
|
1738 | + $this->out('/Width ' . $info['w']); |
|
1739 | + $this->out('/Height ' . $info['h']); |
|
1740 | + if ($info['cs'] == 'Indexed') { |
|
1741 | + $this->out('/ColorSpace [/Indexed /DeviceRGB ' . (strlen($info['pal']) / 3 - 1) . ' ' . ($this->n + 1) . ' 0 R]'); |
|
1742 | 1742 | } else { |
1743 | - $this->out('/ColorSpace /'.$info['cs']); |
|
1744 | - if ($info['cs']=='DeviceCMYK') { |
|
1743 | + $this->out('/ColorSpace /' . $info['cs']); |
|
1744 | + if ($info['cs'] == 'DeviceCMYK') { |
|
1745 | 1745 | $this->out('/Decode [1 0 1 0 1 0 1 0]'); |
1746 | 1746 | } |
1747 | 1747 | } |
1748 | - $this->out('/BitsPerComponent '.$info['bpc']); |
|
1748 | + $this->out('/BitsPerComponent ' . $info['bpc']); |
|
1749 | 1749 | if (isset($info['f'])) { |
1750 | - $this->out('/Filter /'.$info['f']); |
|
1750 | + $this->out('/Filter /' . $info['f']); |
|
1751 | 1751 | } |
1752 | 1752 | if (isset($info['parms'])) { |
1753 | 1753 | $this->out($info['parms']); |
1754 | 1754 | } |
1755 | 1755 | if (isset($info['trns']) && is_array($info['trns'])) { |
1756 | 1756 | $trns = ''; |
1757 | - for ($i=0; $i<count($info['trns']); $i++) { |
|
1758 | - $trns.=$info['trns'][$i].' '.$info['trns'][$i].' '; |
|
1757 | + for ($i = 0; $i < count($info['trns']); $i++) { |
|
1758 | + $trns .= $info['trns'][$i] . ' ' . $info['trns'][$i] . ' '; |
|
1759 | 1759 | } |
1760 | - $this->out('/Mask ['.$trns.']'); |
|
1760 | + $this->out('/Mask [' . $trns . ']'); |
|
1761 | 1761 | } |
1762 | - $this->out('/Length '.strlen($info['data']).'>>'); |
|
1762 | + $this->out('/Length ' . strlen($info['data']) . '>>'); |
|
1763 | 1763 | $this->putStream($info['data']); |
1764 | 1764 | unset($this->images[$file]['data']); |
1765 | 1765 | $this->out('endobj'); |
1766 | 1766 | //Palette |
1767 | 1767 | if ($info['cs'] == 'Indexed') { |
1768 | 1768 | $this->newObj(); |
1769 | - $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
1770 | - $this->out('<<'.$filter.'/Length '.strlen($pal).'>>'); |
|
1769 | + $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
1770 | + $this->out('<<' . $filter . '/Length ' . strlen($pal) . '>>'); |
|
1771 | 1771 | $this->putStream($pal); |
1772 | 1772 | $this->out('endobj'); |
1773 | 1773 | } |
@@ -1777,7 +1777,7 @@ discard block |
||
1777 | 1777 | protected function putXobjectDict() |
1778 | 1778 | { |
1779 | 1779 | foreach ($this->images as $image) { |
1780 | - $this->out('/I'.$image['i'].' '.$image['n'].' 0 R'); |
|
1780 | + $this->out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
1781 | 1781 | } |
1782 | 1782 | } |
1783 | 1783 | |
@@ -1786,7 +1786,7 @@ discard block |
||
1786 | 1786 | $this->out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
1787 | 1787 | $this->out('/Font <<'); |
1788 | 1788 | foreach ($this->fonts as $font) { |
1789 | - $this->out('/F'.$font['i'].' '.$font['n'].' 0 R'); |
|
1789 | + $this->out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
1790 | 1790 | } |
1791 | 1791 | $this->out('>>'); |
1792 | 1792 | $this->out('/XObject <<'); |
@@ -1809,57 +1809,57 @@ discard block |
||
1809 | 1809 | |
1810 | 1810 | protected function putInfo() |
1811 | 1811 | { |
1812 | - $this->out('/Producer '.$this->textString('FPDF '. self::FPDF_VERSION)); |
|
1812 | + $this->out('/Producer ' . $this->textString('FPDF ' . self::FPDF_VERSION)); |
|
1813 | 1813 | if (!empty($this->title)) { |
1814 | - $this->out('/Title '.$this->textString($this->title)); |
|
1814 | + $this->out('/Title ' . $this->textString($this->title)); |
|
1815 | 1815 | } |
1816 | 1816 | if (!empty($this->subject)) { |
1817 | - $this->out('/Subject '.$this->textString($this->subject)); |
|
1817 | + $this->out('/Subject ' . $this->textString($this->subject)); |
|
1818 | 1818 | } |
1819 | 1819 | if (!empty($this->author)) { |
1820 | - $this->out('/Author '.$this->textString($this->author)); |
|
1820 | + $this->out('/Author ' . $this->textString($this->author)); |
|
1821 | 1821 | } |
1822 | 1822 | if (!empty($this->keywords)) { |
1823 | - $this->out('/Keywords '.$this->textString($this->keywords)); |
|
1823 | + $this->out('/Keywords ' . $this->textString($this->keywords)); |
|
1824 | 1824 | } |
1825 | 1825 | if (!empty($this->creator)) { |
1826 | - $this->out('/Creator '.$this->textString($this->creator)); |
|
1826 | + $this->out('/Creator ' . $this->textString($this->creator)); |
|
1827 | 1827 | } |
1828 | - $this->out('/CreationDate '.$this->textString('D:'.@date('YmdHis'))); |
|
1828 | + $this->out('/CreationDate ' . $this->textString('D:' . @date('YmdHis'))); |
|
1829 | 1829 | } |
1830 | 1830 | |
1831 | 1831 | protected function putCatalog() |
1832 | 1832 | { |
1833 | 1833 | $this->out('/Type /Catalog'); |
1834 | 1834 | $this->out('/Pages 1 0 R'); |
1835 | - if ($this->zoomMode=='fullpage') { |
|
1835 | + if ($this->zoomMode == 'fullpage') { |
|
1836 | 1836 | $this->out('/OpenAction [3 0 R /Fit]'); |
1837 | - } elseif ($this->zoomMode=='fullwidth') { |
|
1837 | + } elseif ($this->zoomMode == 'fullwidth') { |
|
1838 | 1838 | $this->out('/OpenAction [3 0 R /FitH null]'); |
1839 | - } elseif ($this->zoomMode=='real') { |
|
1839 | + } elseif ($this->zoomMode == 'real') { |
|
1840 | 1840 | $this->out('/OpenAction [3 0 R /XYZ null null 1]'); |
1841 | 1841 | } elseif (!is_string($this->zoomMode)) { |
1842 | - $this->out('/OpenAction [3 0 R /XYZ null null '.($this->zoomMode/100).']'); |
|
1842 | + $this->out('/OpenAction [3 0 R /XYZ null null ' . ($this->zoomMode / 100) . ']'); |
|
1843 | 1843 | } |
1844 | - if ($this->layoutMode=='single') { |
|
1844 | + if ($this->layoutMode == 'single') { |
|
1845 | 1845 | $this->out('/PageLayout /SinglePage'); |
1846 | - } elseif ($this->layoutMode=='continuous') { |
|
1846 | + } elseif ($this->layoutMode == 'continuous') { |
|
1847 | 1847 | $this->out('/PageLayout /OneColumn'); |
1848 | - } elseif ($this->layoutMode=='two') { |
|
1848 | + } elseif ($this->layoutMode == 'two') { |
|
1849 | 1849 | $this->out('/PageLayout /TwoColumnLeft'); |
1850 | 1850 | } |
1851 | 1851 | } |
1852 | 1852 | |
1853 | 1853 | protected function putHeader() |
1854 | 1854 | { |
1855 | - $this->out('%PDF-'.$this->pdfVersion); |
|
1855 | + $this->out('%PDF-' . $this->pdfVersion); |
|
1856 | 1856 | } |
1857 | 1857 | |
1858 | 1858 | protected function putTrailer() |
1859 | 1859 | { |
1860 | - $this->out('/Size '.($this->n+1)); |
|
1861 | - $this->out('/Root '.$this->n.' 0 R'); |
|
1862 | - $this->out('/Info '.($this->n-1).' 0 R'); |
|
1860 | + $this->out('/Size ' . ($this->n + 1)); |
|
1861 | + $this->out('/Root ' . $this->n . ' 0 R'); |
|
1862 | + $this->out('/Info ' . ($this->n - 1) . ' 0 R'); |
|
1863 | 1863 | } |
1864 | 1864 | |
1865 | 1865 | protected function endDoc() |
@@ -1880,11 +1880,11 @@ discard block |
||
1880 | 1880 | $this->out('>>'); |
1881 | 1881 | $this->out('endobj'); |
1882 | 1882 | //Cross-ref |
1883 | - $o=strlen($this->buffer); |
|
1883 | + $o = strlen($this->buffer); |
|
1884 | 1884 | $this->out('xref'); |
1885 | - $this->out('0 '.($this->n+1)); |
|
1885 | + $this->out('0 ' . ($this->n + 1)); |
|
1886 | 1886 | $this->out('0000000000 65535 f '); |
1887 | - for ($i=1; $i<=$this->n; $i++) { |
|
1887 | + for ($i = 1; $i <= $this->n; $i++) { |
|
1888 | 1888 | $this->out(sprintf('%010d 00000 n ', $this->offsets[$i])); |
1889 | 1889 | } |
1890 | 1890 | //Trailer |
@@ -1895,6 +1895,6 @@ discard block |
||
1895 | 1895 | $this->out('startxref'); |
1896 | 1896 | $this->out($o); |
1897 | 1897 | $this->out('%%EOF'); |
1898 | - $this->state=3; |
|
1898 | + $this->state = 3; |
|
1899 | 1899 | } |
1900 | 1900 | } |
@@ -1004,8 +1004,8 @@ discard block |
||
1004 | 1004 | *cabecalhoDANFE |
1005 | 1005 | * Monta o cabelhalho da DANFE (retrato e paisagem) |
1006 | 1006 | * |
1007 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
1008 | - * @param number $y Posição vertical inicial, canto superior |
|
1007 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
1008 | + * @param integer $y Posição vertical inicial, canto superior |
|
1009 | 1009 | * @param number $pag Número da Página |
1010 | 1010 | * @param number $totPag Total de páginas |
1011 | 1011 | * @return number Posição vertical final |
@@ -1443,8 +1443,8 @@ discard block |
||
1443 | 1443 | * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem) |
1444 | 1444 | * |
1445 | 1445 | * @name destinatarioDANFE |
1446 | - * @param number $x Posição horizontal canto esquerdo |
|
1447 | - * @param number $y Posição vertical canto superior |
|
1446 | + * @param integer $x Posição horizontal canto esquerdo |
|
1447 | + * @param integer $y Posição vertical canto superior |
|
1448 | 1448 | * @return number Posição vertical final |
1449 | 1449 | */ |
1450 | 1450 | protected function pDestinatarioDANFE($x = 0, $y = 0) |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | * Gera a String do Texto da Fatura |
1645 | 1645 | * |
1646 | 1646 | * @name getTextoFatura |
1647 | - * @return uma String com o texto ou ""; |
|
1647 | + * @return string String com o texto ou ""; |
|
1648 | 1648 | */ |
1649 | 1649 | protected function pGetTextoFatura() |
1650 | 1650 | { |
@@ -1698,8 +1698,8 @@ discard block |
||
1698 | 1698 | * Monta o campo de duplicatas da DANFE (retrato e paisagem) |
1699 | 1699 | * |
1700 | 1700 | * @name faturaDANFE |
1701 | - * @param number $x Posição horizontal canto esquerdo |
|
1702 | - * @param number $y Posição vertical canto superior |
|
1701 | + * @param integer $x Posição horizontal canto esquerdo |
|
1702 | + * @param double $y Posição vertical canto superior |
|
1703 | 1703 | * @return number Posição vertical final |
1704 | 1704 | */ |
1705 | 1705 | protected function pFaturaDANFE($x, $y) |
@@ -1806,8 +1806,8 @@ discard block |
||
1806 | 1806 | * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na faturaDANFE) |
1807 | 1807 | * |
1808 | 1808 | * @name pagamentoDANFE |
1809 | - * @param number $x Posição horizontal canto esquerdo |
|
1810 | - * @param number $y Posição vertical canto superior |
|
1809 | + * @param integer $x Posição horizontal canto esquerdo |
|
1810 | + * @param double $y Posição vertical canto superior |
|
1811 | 1811 | * @return number Posição vertical final |
1812 | 1812 | */ |
1813 | 1813 | protected function pagamentoDANFE($x, $y) |
@@ -1898,6 +1898,8 @@ discard block |
||
1898 | 1898 | * @param float $h Altura do campo |
1899 | 1899 | * @param float $h Título do campo |
1900 | 1900 | * @param float $h Valor do imposto |
1901 | + * @param string $titulo |
|
1902 | + * @param string $campoImposto |
|
1901 | 1903 | * @return float Sugestão do $x do próximo imposto |
1902 | 1904 | */ |
1903 | 1905 | protected function pImpostoDanfeHelper($x, $y, $w, $h, $titulo, $campoImposto) |
@@ -1924,9 +1926,9 @@ discard block |
||
1924 | 1926 | * impostoDANFE |
1925 | 1927 | * Monta o campo de impostos e totais da DANFE (retrato e paisagem) |
1926 | 1928 | * |
1927 | - * @param number $x Posição horizontal canto esquerdo |
|
1928 | - * @param number $y Posição vertical canto superior |
|
1929 | - * @return number Posição vertical final |
|
1929 | + * @param integer $x Posição horizontal canto esquerdo |
|
1930 | + * @param double $y Posição vertical canto superior |
|
1931 | + * @return double Posição vertical final |
|
1930 | 1932 | */ |
1931 | 1933 | protected function pImpostoDANFE($x, $y) |
1932 | 1934 | { |
@@ -2308,6 +2310,10 @@ discard block |
||
2308 | 2310 | |
2309 | 2311 | |
2310 | 2312 | |
2313 | + /** |
|
2314 | + * @param string $campo |
|
2315 | + * @param string $formato |
|
2316 | + */ |
|
2311 | 2317 | protected function pDescricaoProdutoHelper($origem, $campo, $formato) |
2312 | 2318 | { |
2313 | 2319 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
@@ -2403,7 +2409,6 @@ discard block |
||
2403 | 2409 | * @param float $x Posição horizontal canto esquerdo |
2404 | 2410 | * @param float $y Posição vertical canto superior |
2405 | 2411 | * @param float $nInicio Número do item inicial |
2406 | - * @param float $max Número do item final |
|
2407 | 2412 | * @param float $hmax Altura máxima do campo de itens em mm |
2408 | 2413 | * @return float Posição vertical final |
2409 | 2414 | */ |
@@ -2853,8 +2858,7 @@ discard block |
||
2853 | 2858 | * sobre a API NfePHP |
2854 | 2859 | * |
2855 | 2860 | * @name pRodape |
2856 | - * @param float $xInic Posição horizontal canto esquerdo |
|
2857 | - * @param float $yFinal Posição vertical final para impressão |
|
2861 | + * @param integer $x |
|
2858 | 2862 | * @return void |
2859 | 2863 | */ |
2860 | 2864 | protected function pRodape($x, $y) |
@@ -2877,7 +2881,7 @@ discard block |
||
2877 | 2881 | * Monta o canhoto da DANFE (retrato e paisagem) |
2878 | 2882 | * |
2879 | 2883 | * @name canhotoDANFE |
2880 | - * @param number $x Posição horizontal canto esquerdo |
|
2884 | + * @param integer $x Posição horizontal canto esquerdo |
|
2881 | 2885 | * @param number $y Posição vertical canto superior |
2882 | 2886 | * @return number Posição vertical final |
2883 | 2887 | * |
@@ -3168,6 +3172,9 @@ discard block |
||
3168 | 3172 | return $saida; |
3169 | 3173 | } |
3170 | 3174 | |
3175 | + /** |
|
3176 | + * @param string $original |
|
3177 | + */ |
|
3171 | 3178 | private function imagePNGtoJPG($original) |
3172 | 3179 | { |
3173 | 3180 | $image = imagecreatefrompng($original); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | $this->textoAdic .= ". \r\n"; |
596 | 596 | } |
597 | 597 | $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
598 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
598 | + ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
599 | 599 | } |
600 | 600 | //informações adicionais |
601 | 601 | $this->textoAdic .= $this->pGeraInformacoesDasNotasReferenciadas(); |
@@ -791,8 +791,8 @@ discard block |
||
791 | 791 | //retorna o ID na NFe |
792 | 792 | if ($classPdf!==false) { |
793 | 793 | $aR = array( |
794 | - 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
795 | - 'classe_PDF'=>$this->pdf); |
|
794 | + 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
795 | + 'classe_PDF'=>$this->pdf); |
|
796 | 796 | return $aR; |
797 | 797 | } else { |
798 | 798 | return str_replace('NFe', '', $this->infNFe->getAttribute("Id")); |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | $oldX = $x; |
1004 | 1004 | $oldY = $y; |
1005 | 1005 | if ($this->orientacao == 'P') { |
1006 | - $maxW = $this->wPrint; |
|
1006 | + $maxW = $this->wPrint; |
|
1007 | 1007 | } else { |
1008 | 1008 | if ($pag == 1) { // primeira página |
1009 | 1009 | $maxW = $this->wPrint - $this->wCanhoto; |
@@ -1339,8 +1339,8 @@ discard block |
||
1339 | 1339 | $w = $maxW-(2*$x); |
1340 | 1340 | $this->pdf->SetTextColor(200, 200, 200); |
1341 | 1341 | $texto = "DANFE impresso em contingência -\n". |
1342 | - "DPEC regularmente recebido pela Receita\n". |
|
1343 | - "Federal do Brasil"; |
|
1342 | + "DPEC regularmente recebido pela Receita\n". |
|
1343 | + "Federal do Brasil"; |
|
1344 | 1344 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
1345 | 1345 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1346 | 1346 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1627,13 +1627,13 @@ discard block |
||
1627 | 1627 | return ($y + $h); |
1628 | 1628 | } //fim da função destinatarioDANFE |
1629 | 1629 | |
1630 | - /** |
|
1631 | - * pGetTextoFatura |
|
1632 | - * Gera a String do Texto da Fatura |
|
1633 | - * |
|
1634 | - * @name getTextoFatura |
|
1635 | - * @return uma String com o texto ou ""; |
|
1636 | - */ |
|
1630 | + /** |
|
1631 | + * pGetTextoFatura |
|
1632 | + * Gera a String do Texto da Fatura |
|
1633 | + * |
|
1634 | + * @name getTextoFatura |
|
1635 | + * @return uma String com o texto ou ""; |
|
1636 | + */ |
|
1637 | 1637 | protected function pGetTextoFatura() |
1638 | 1638 | { |
1639 | 1639 | if (isset($this->cobr)) { |
@@ -1664,13 +1664,13 @@ discard block |
||
1664 | 1664 | return ""; |
1665 | 1665 | } //fim getTextoFatura |
1666 | 1666 | |
1667 | - /** |
|
1668 | - * pSizeExtraTextoFatura |
|
1669 | - * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
1670 | - * |
|
1671 | - * @name pSizeExtraTextoFatura |
|
1672 | - * @return integer |
|
1673 | - */ |
|
1667 | + /** |
|
1668 | + * pSizeExtraTextoFatura |
|
1669 | + * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
1670 | + * |
|
1671 | + * @name pSizeExtraTextoFatura |
|
1672 | + * @return integer |
|
1673 | + */ |
|
1674 | 1674 | protected function pSizeExtraTextoFatura() |
1675 | 1675 | { |
1676 | 1676 | $textoFatura = $this->pGetTextoFatura(); |
@@ -1835,7 +1835,7 @@ discard block |
||
1835 | 1835 | '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
1836 | 1836 | '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'); |
1837 | 1837 | $bandeira = array('01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
1838 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
1838 | + '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
1839 | 1839 | foreach ($this->detPag as $k => $d) { |
1840 | 1840 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
1841 | 1841 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
@@ -2463,7 +2463,7 @@ discard block |
||
2463 | 2463 | $w4 = round($w*0.05, 0); |
2464 | 2464 | $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
2465 | 2465 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
2466 | - $texto = 'O/CST';//Regime Normal |
|
2466 | + $texto = 'O/CST';//Regime Normal |
|
2467 | 2467 | } |
2468 | 2468 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2469 | 2469 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2971,9 +2971,9 @@ discard block |
||
2971 | 2971 | //DADOS ADICIONAIS |
2972 | 2972 | $texto = "DADOS ADICIONAIS"; |
2973 | 2973 | if ($this->orientacao == 'P') { |
2974 | - $w = $this->wPrint; |
|
2974 | + $w = $this->wPrint; |
|
2975 | 2975 | } else { |
2976 | - $w = $this->wPrint-$this->wCanhoto; |
|
2976 | + $w = $this->wPrint-$this->wCanhoto; |
|
2977 | 2977 | } |
2978 | 2978 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
2979 | 2979 | $this->pTextBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3053,10 +3053,10 @@ discard block |
||
3053 | 3053 | protected function pRodape($x, $y) |
3054 | 3054 | { |
3055 | 3055 | if ($this->orientacao == 'P') { |
3056 | - $w = $this->wPrint; |
|
3056 | + $w = $this->wPrint; |
|
3057 | 3057 | } else { |
3058 | - $w = $this->wPrint-$this->wCanhoto; |
|
3059 | - $x = $this->wCanhoto; |
|
3058 | + $w = $this->wPrint-$this->wCanhoto; |
|
3059 | + $x = $this->wCanhoto; |
|
3060 | 3060 | } |
3061 | 3061 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
3062 | 3062 | $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s'); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $this->fontePadrao = $fonteDANFE; |
356 | 356 | } |
357 | 357 | //se for passado o xml |
358 | - if (! empty($this->xml)) { |
|
358 | + if (!empty($this->xml)) { |
|
359 | 359 | $this->dom = new Dom(); |
360 | 360 | $this->dom->loadXML($this->xml); |
361 | 361 | $this->nfeProc = $this->dom->getElementsByTagName("nfeProc")->item(0); |
@@ -511,10 +511,10 @@ discard block |
||
511 | 511 | //total inicial de paginas |
512 | 512 | $totPag = 1; |
513 | 513 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
514 | - $this->wPrint = $maxW-($margEsq*2); |
|
514 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
515 | 515 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
516 | 516 | //superior e inferior |
517 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
517 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
518 | 518 | // estabelece contagem de paginas |
519 | 519 | $this->pdf->aliasNbPages(); |
520 | 520 | // fixa as margens |
@@ -552,9 +552,9 @@ discard block |
||
552 | 552 | } |
553 | 553 | //calcular a altura necessária para os dados adicionais |
554 | 554 | if ($this->orientacao == 'P') { |
555 | - $this->wAdic = round($this->wPrint*0.66, 0); |
|
555 | + $this->wAdic = round($this->wPrint * 0.66, 0); |
|
556 | 556 | } else { |
557 | - $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0); |
|
557 | + $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0); |
|
558 | 558 | } |
559 | 559 | $fontProduto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
560 | 560 | $this->textoAdic = ''; |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | $txRetxBairro = $this->getTagValue($this->retirada, "xBairro"); |
567 | 567 | $txRetxMun = $this->getTagValue($this->retirada, "xMun"); |
568 | 568 | $txRetUF = $this->getTagValue($this->retirada, "UF"); |
569 | - $this->textoAdic .= "LOCAL DE RETIRADA : ". |
|
570 | - $txRetCNPJ. |
|
569 | + $this->textoAdic .= "LOCAL DE RETIRADA : " . |
|
570 | + $txRetCNPJ . |
|
571 | 571 | '-' . |
572 | 572 | $txRetxLgr . |
573 | 573 | ', ' . |
@@ -594,8 +594,8 @@ discard block |
||
594 | 594 | if ($this->textoAdic != '') { |
595 | 595 | $this->textoAdic .= ". \r\n"; |
596 | 596 | } |
597 | - $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
|
598 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
597 | + $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl . |
|
598 | + ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n"; |
|
599 | 599 | } |
600 | 600 | //informações adicionais |
601 | 601 | $this->textoAdic .= $this->pGeraInformacoesDasNotasReferenciadas(); |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if ($this->textoAdic != '') { |
605 | 605 | $this->textoAdic .= ". \r\n"; |
606 | 606 | } |
607 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
607 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
608 | 608 | 'Inf. Contribuinte: ' . |
609 | 609 | $this->pAnfavea($this->getTagValue($this->infAdic, "infCpl")) : ''; |
610 | 610 | $infPedido = $this->pGeraInformacoesDaTagCompra(); |
@@ -612,14 +612,14 @@ discard block |
||
612 | 612 | $this->textoAdic .= $infPedido; |
613 | 613 | } |
614 | 614 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
615 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
615 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
616 | 616 | "\r\n Inf. fisco: " . |
617 | 617 | $this->getTagValue($this->infAdic, "infAdFisco") : ''; |
618 | 618 | $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
619 | 619 | if (isset($obsCont)) { |
620 | 620 | foreach ($obsCont as $obs) { |
621 | - $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
622 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
621 | + $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
622 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
623 | 623 | $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue : ''; |
624 | 624 | $this->textoAdic .= "\r\n" . $campo . ': ' . trim($xTexto); |
625 | 625 | $i++; |
@@ -647,38 +647,38 @@ discard block |
||
647 | 647 | foreach ($alinhas as $linha) { |
648 | 648 | $numlinhasdados += $this->pGetNumLines($linha, $this->wAdic, $fontProduto); |
649 | 649 | } |
650 | - $hdadosadic = round(($numlinhasdados+3) * $this->pdf->fontSize, 0); |
|
650 | + $hdadosadic = round(($numlinhasdados + 3) * $this->pdf->fontSize, 0); |
|
651 | 651 | if ($hdadosadic < 10) { |
652 | 652 | $hdadosadic = 10; |
653 | 653 | } |
654 | 654 | //altura disponivel para os campos da DANFE |
655 | - $hcabecalho = 47;//para cabeçalho |
|
656 | - $hdestinatario = 25;//para destinatario |
|
657 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
658 | - $himposto = 18;// para imposto |
|
659 | - $htransporte = 25;// para transporte |
|
660 | - $hissqn = 11;// para issqn |
|
661 | - $hfooter = 5;// para rodape |
|
662 | - $hCabecItens = 4;//cabeçalho dos itens |
|
655 | + $hcabecalho = 47; //para cabeçalho |
|
656 | + $hdestinatario = 25; //para destinatario |
|
657 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
658 | + $himposto = 18; // para imposto |
|
659 | + $htransporte = 25; // para transporte |
|
660 | + $hissqn = 11; // para issqn |
|
661 | + $hfooter = 5; // para rodape |
|
662 | + $hCabecItens = 4; //cabeçalho dos itens |
|
663 | 663 | //alturas disponiveis para os dados |
664 | 664 | $hDispo1 = $this->hPrint - 10 - ($hcabecalho + |
665 | 665 | $hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte + |
666 | 666 | ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens + |
667 | 667 | $this->pSizeExtraTextoFatura()); |
668 | 668 | if ($this->orientacao == 'P') { |
669 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
669 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
670 | 670 | $w = $this->wPrint; |
671 | 671 | } else { |
672 | - $hcanhoto = $this->hPrint;//para canhoto |
|
672 | + $hcanhoto = $this->hPrint; //para canhoto |
|
673 | 673 | $w = $this->wPrint - $this->wCanhoto; |
674 | 674 | } |
675 | - $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4; |
|
675 | + $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4; |
|
676 | 676 | //Contagem da altura ocupada para impressão dos itens |
677 | 677 | $fontProduto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
678 | 678 | $i = 1; |
679 | 679 | $numlinhas = 0; |
680 | 680 | $hUsado = $hCabecItens; |
681 | - $w2 = round($w*0.28, 0); |
|
681 | + $w2 = round($w * 0.28, 0); |
|
682 | 682 | $hDispo = $hDispo1; |
683 | 683 | $totPag = 1; |
684 | 684 | while ($i < $this->det->length) { |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | $hDispo = $hDispo2; |
691 | 691 | $hUsado = $hCabecItens; |
692 | 692 | // Remove canhoto para páginas secundárias em modo paisagem ('L') |
693 | - $w2 = round($this->wPrint*0.28, 0); |
|
693 | + $w2 = round($this->wPrint * 0.28, 0); |
|
694 | 694 | $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
695 | 695 | } |
696 | 696 | $i++; |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | //coloca o cabeçalho |
715 | 715 | $y = $this->pCabecalhoDANFE($x, $y, $pag, $totPag); |
716 | 716 | //coloca os dados do destinatário |
717 | - $y = $this->pDestinatarioDANFE($x, $y+1); |
|
717 | + $y = $this->pDestinatarioDANFE($x, $y + 1); |
|
718 | 718 | |
719 | 719 | |
720 | 720 | //Verifica as formas de pagamento da nota fiscal |
@@ -728,27 +728,27 @@ discard block |
||
728 | 728 | } |
729 | 729 | //caso tenha boleto imprimir fatura |
730 | 730 | if ($this->dup->length > 0) { |
731 | - $y = $this->pFaturaDANFE($x, $y+1); |
|
731 | + $y = $this->pFaturaDANFE($x, $y + 1); |
|
732 | 732 | } else { |
733 | 733 | //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada |
734 | - if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
734 | + if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
735 | 735 | $y = $y; |
736 | 736 | } else { |
737 | 737 | //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a |
738 | 738 | //forma de pagamento e o valor |
739 | - $y = $this->pagamentoDANFE($x, $y+1); |
|
739 | + $y = $this->pagamentoDANFE($x, $y + 1); |
|
740 | 740 | } |
741 | 741 | } |
742 | 742 | //coloca os dados dos impostos e totais da NFe |
743 | - $y = $this->pImpostoDANFE($x, $y+1); |
|
743 | + $y = $this->pImpostoDANFE($x, $y + 1); |
|
744 | 744 | //coloca os dados do trasnporte |
745 | - $y = $this->pTransporteDANFE($x, $y+1); |
|
745 | + $y = $this->pTransporteDANFE($x, $y + 1); |
|
746 | 746 | //itens da DANFE |
747 | 747 | $nInicial = 0; |
748 | - $y = $this->pItensDANFE($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
748 | + $y = $this->pItensDANFE($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
749 | 749 | //coloca os dados do ISSQN |
750 | 750 | if ($linhaISSQN == 1) { |
751 | - $y = $this->pIssqnDANFE($x, $y+4); |
|
751 | + $y = $this->pIssqnDANFE($x, $y + 4); |
|
752 | 752 | } else { |
753 | 753 | $y += 4; |
754 | 754 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $y = $this->pDadosAdicionaisDANFE($x, $y, $hdadosadic); |
757 | 757 | //coloca o rodapé da página |
758 | 758 | if ($this->orientacao == 'P') { |
759 | - $this->pRodape($xInic, $y-1); |
|
759 | + $this->pRodape($xInic, $y - 1); |
|
760 | 760 | } else { |
761 | 761 | $this->pRodape($xInic, $this->hPrint + 1); |
762 | 762 | } |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | //coloca o cabeçalho na página adicional |
777 | 777 | $y = $this->pCabecalhoDANFE($x, $y, $n, $totPag); |
778 | 778 | //coloca os itens na página adicional |
779 | - $y = $this->pItensDANFE($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
779 | + $y = $this->pItensDANFE($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
780 | 780 | //coloca o rodapé da página |
781 | 781 | if ($this->orientacao == 'P') { |
782 | 782 | $this->pRodape($xInic, $y + 4); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | } |
790 | 790 | } |
791 | 791 | //retorna o ID na NFe |
792 | - if ($classPdf!==false) { |
|
792 | + if ($classPdf !== false) { |
|
793 | 793 | $aR = array( |
794 | 794 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
795 | 795 | 'classe_PDF'=>$this->pdf); |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | if ($startPos === false) { |
823 | 823 | return $cdata; |
824 | 824 | } |
825 | - for ($x=$len; $x>0; $x--) { |
|
825 | + for ($x = $len; $x > 0; $x--) { |
|
826 | 826 | if (substr($cdata, $x, 1) == '>') { |
827 | 827 | $endPos = $x; |
828 | 828 | break; |
@@ -833,15 +833,15 @@ discard block |
||
833 | 833 | } else { |
834 | 834 | $parte1 = ''; |
835 | 835 | } |
836 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
836 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
837 | 837 | if ($endPos < $len) { |
838 | 838 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
839 | 839 | } else { |
840 | 840 | $parte3 = ''; |
841 | 841 | } |
842 | - $texto = trim($parte1).' '.trim($parte3); |
|
842 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
843 | 843 | if (strpos($parte2, '<CDATA>') === false) { |
844 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
844 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
845 | 845 | } else { |
846 | 846 | $cdata = $parte2; |
847 | 847 | } |
@@ -915,15 +915,15 @@ discard block |
||
915 | 915 | //grupo CADATA infCpl |
916 | 916 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
917 | 917 | $r = $dom->getElementsByTagName('receptor')->item(0); |
918 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
919 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
920 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
921 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
922 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
923 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
924 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
925 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
926 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
918 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
919 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
920 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
921 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
922 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
923 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
924 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
925 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
926 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
927 | 927 | if (isset($t)) { |
928 | 928 | if ($t->hasAttributes()) { |
929 | 929 | $texto .= " Transmissor "; |
@@ -1013,14 +1013,14 @@ discard block |
||
1013 | 1013 | } |
1014 | 1014 | //#################################################################################### |
1015 | 1015 | //coluna esquerda identificação do emitente |
1016 | - $w = round($maxW*0.41, 0); |
|
1016 | + $w = round($maxW * 0.41, 0); |
|
1017 | 1017 | if ($this->orientacao == 'P') { |
1018 | 1018 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
1019 | 1019 | } else { |
1020 | 1020 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
1021 | 1021 | } |
1022 | 1022 | $w1 = $w; |
1023 | - $h=32; |
|
1023 | + $h = 32; |
|
1024 | 1024 | $oldY += $h; |
1025 | 1025 | $this->pTextBox($x, $y, $w, $h); |
1026 | 1026 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -1041,39 +1041,39 @@ discard block |
||
1041 | 1041 | $type == 'jpg'; |
1042 | 1042 | } |
1043 | 1043 | //largura da imagem em mm |
1044 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
1044 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
1045 | 1045 | //altura da imagem em mm |
1046 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
1047 | - if ($this->logoAlign=='L') { |
|
1048 | - $nImgW = round($w/3, 0); |
|
1049 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
1050 | - $xImg = $x+1; |
|
1051 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
1046 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
1047 | + if ($this->logoAlign == 'L') { |
|
1048 | + $nImgW = round($w / 3, 0); |
|
1049 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
1050 | + $xImg = $x + 1; |
|
1051 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
1052 | 1052 | //estabelecer posições do texto |
1053 | - $x1 = round($xImg + $nImgW +1, 0); |
|
1054 | - $y1 = round($h/3+$y, 0); |
|
1055 | - $tw = round(2*$w/3, 0); |
|
1056 | - } elseif ($this->logoAlign=='C') { |
|
1057 | - $nImgH = round($h/3, 0); |
|
1058 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
1059 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
1060 | - $yImg = $y+3; |
|
1053 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
1054 | + $y1 = round($h / 3 + $y, 0); |
|
1055 | + $tw = round(2 * $w / 3, 0); |
|
1056 | + } elseif ($this->logoAlign == 'C') { |
|
1057 | + $nImgH = round($h / 3, 0); |
|
1058 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
1059 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
1060 | + $yImg = $y + 3; |
|
1061 | 1061 | $x1 = $x; |
1062 | 1062 | $y1 = round($yImg + $nImgH + 1, 0); |
1063 | 1063 | $tw = $w; |
1064 | - } elseif ($this->logoAlign=='R') { |
|
1065 | - $nImgW = round($w/3, 0); |
|
1066 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
1067 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
1068 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
1064 | + } elseif ($this->logoAlign == 'R') { |
|
1065 | + $nImgW = round($w / 3, 0); |
|
1066 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
1067 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
1068 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
1069 | 1069 | $x1 = $x; |
1070 | - $y1 = round($h/3+$y, 0); |
|
1071 | - $tw = round(2*$w/3, 0); |
|
1072 | - } elseif ($this->logoAlign=='F') { |
|
1073 | - $nImgH = round($h-5, 0); |
|
1074 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
1075 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
1076 | - $yImg = $y+3; |
|
1070 | + $y1 = round($h / 3 + $y, 0); |
|
1071 | + $tw = round(2 * $w / 3, 0); |
|
1072 | + } elseif ($this->logoAlign == 'F') { |
|
1073 | + $nImgH = round($h - 5, 0); |
|
1074 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
1075 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
1076 | + $yImg = $y + 3; |
|
1077 | 1077 | $x1 = $x; |
1078 | 1078 | $y1 = round($yImg + $nImgH + 1, 0); |
1079 | 1079 | $tw = $w; |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type); |
1083 | 1083 | } else { |
1084 | 1084 | $x1 = $x; |
1085 | - $y1 = round($h/3+$y, 0); |
|
1085 | + $y1 = round($h / 3 + $y, 0); |
|
1086 | 1086 | $tw = $w; |
1087 | 1087 | } |
1088 | 1088 | // monta as informações apenas se diferente de full logo |
@@ -1092,9 +1092,9 @@ discard block |
||
1092 | 1092 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
1093 | 1093 | $this->pTextBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
1094 | 1094 | //endereço |
1095 | - $y1 = $y1+5; |
|
1095 | + $y1 = $y1 + 5; |
|
1096 | 1096 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
1097 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1097 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1098 | 1098 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
1099 | 1099 | : ''; |
1100 | 1100 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1114,37 +1114,37 @@ discard block |
||
1114 | 1114 | //#################################################################################### |
1115 | 1115 | //coluna central Danfe |
1116 | 1116 | $x += $w; |
1117 | - $w=round($maxW * 0.17, 0);//35; |
|
1117 | + $w = round($maxW * 0.17, 0); //35; |
|
1118 | 1118 | $w2 = $w; |
1119 | 1119 | $h = 32; |
1120 | 1120 | $this->pTextBox($x, $y, $w, $h); |
1121 | 1121 | |
1122 | - if (! $this->pNotaCancelada()) { |
|
1122 | + if (!$this->pNotaCancelada()) { |
|
1123 | 1123 | // A PRINCIPIO NÃO PRECISAVA, POIS A NFE ESTÁ AUTORIZADA, |
1124 | 1124 | // SÓ SE RETIRA O DANFE PARA NOTAS NÃO AUTORIZADAS |
1125 | 1125 | $texto = "DANFE"; |
1126 | 1126 | $aFont = array('font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'); |
1127 | - $this->pTextBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1127 | + $this->pTextBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1128 | 1128 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
1129 | 1129 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
1130 | 1130 | $h = 20; |
1131 | - $this->pTextBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
1131 | + $this->pTextBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
1135 | 1135 | $texto = '0 - ENTRADA'; |
1136 | 1136 | $y1 = $y + 14; |
1137 | 1137 | $h = 8; |
1138 | - $this->pTextBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1138 | + $this->pTextBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1139 | 1139 | $texto = '1 - SAÍDA'; |
1140 | 1140 | $y1 = $y + 17; |
1141 | - $this->pTextBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1141 | + $this->pTextBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1142 | 1142 | //tipo de nF |
1143 | 1143 | $aFont = array('font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'); |
1144 | 1144 | $y1 = $y + 13; |
1145 | 1145 | $h = 7; |
1146 | 1146 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
1147 | - $this->pTextBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
1147 | + $this->pTextBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
1148 | 1148 | //numero da NF |
1149 | 1149 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1150 | 1150 | $y1 = $y + 20; |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | //#################################################################################### |
1167 | 1167 | //coluna codigo de barras |
1168 | 1168 | $x += $w; |
1169 | - $w = ($maxW-$w1-$w2);//85; |
|
1169 | + $w = ($maxW - $w1 - $w2); //85; |
|
1170 | 1170 | $w3 = $w; |
1171 | 1171 | $h = 32; |
1172 | 1172 | $this->pTextBox($x, $y, $w, $h); |
@@ -1175,22 +1175,22 @@ discard block |
||
1175 | 1175 | $bW = 75; |
1176 | 1176 | $bH = 12; |
1177 | 1177 | //codigo de barras |
1178 | - $this->pdf->Code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
1178 | + $this->pdf->Code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
1179 | 1179 | //linhas divisorias |
1180 | - $this->pdf->Line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
1181 | - $this->pdf->Line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
1180 | + $this->pdf->Line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
1181 | + $this->pdf->Line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
1182 | 1182 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1183 | - $y1 = $y+4+$bH; |
|
1183 | + $y1 = $y + 4 + $bH; |
|
1184 | 1184 | $h = 7; |
1185 | 1185 | $texto = 'CHAVE DE ACESSO'; |
1186 | 1186 | $this->pTextBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1187 | 1187 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
1188 | - $y1 = $y+8+$bH; |
|
1188 | + $y1 = $y + 8 + $bH; |
|
1189 | 1189 | $texto = $this->pFormat($chave_acesso, $this->formatoChave); |
1190 | - $this->pTextBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1191 | - $y1 = $y+12+$bH; |
|
1190 | + $this->pTextBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1191 | + $y1 = $y + 12 + $bH; |
|
1192 | 1192 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
1193 | - $chaveContingencia=""; |
|
1193 | + $chaveContingencia = ""; |
|
1194 | 1194 | if ($this->pNotaDPEC()) { |
1195 | 1195 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
1196 | 1196 | } else { |
@@ -1201,16 +1201,16 @@ discard block |
||
1201 | 1201 | $chaveContingencia = $this->pGeraChaveAdicionalDeContingencia(); |
1202 | 1202 | $this->pdf->SetFillColor(0, 0, 0); |
1203 | 1203 | //codigo de barras |
1204 | - $this->pdf->Code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
1204 | + $this->pdf->Code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
1205 | 1205 | } else { |
1206 | 1206 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
1207 | - $this->pTextBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1208 | - $y1 = $y+16+$bH; |
|
1207 | + $this->pTextBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
1208 | + $y1 = $y + 16 + $bH; |
|
1209 | 1209 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
1210 | 1210 | $this->pTextBox( |
1211 | - $x+2, |
|
1211 | + $x + 2, |
|
1212 | 1212 | $y1, |
1213 | - $w-2, |
|
1213 | + $w - 2, |
|
1214 | 1214 | $h, |
1215 | 1215 | $texto, |
1216 | 1216 | $aFont, |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | //natureza da operação |
1227 | 1227 | $texto = 'NATUREZA DA OPERAÇÃO'; |
1228 | 1228 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1229 | - $w = $w1+$w2; |
|
1229 | + $w = $w1 + $w2; |
|
1230 | 1230 | $y = $oldY; |
1231 | 1231 | $oldY += $h; |
1232 | 1232 | $x = $oldX; |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | $cStat = ''; |
1257 | 1257 | } else { |
1258 | 1258 | if (isset($this->nfeProc)) { |
1259 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
1259 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
1260 | 1260 | $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue : ''; |
1261 | 1261 | $tsHora = $this->pConvertTime($this->nfeProc->getElementsByTagName("dhRecbto")->item(0)->nodeValue); |
1262 | 1262 | if ($texto != '') { |
@@ -1287,25 +1287,25 @@ discard block |
||
1287 | 1287 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
1288 | 1288 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1289 | 1289 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1290 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1290 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1291 | 1291 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
1292 | 1292 | : ''; |
1293 | 1293 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1294 | 1294 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1295 | 1295 | //CNPJ |
1296 | 1296 | $x += $w; |
1297 | - $w = ($maxW-(2*$w)); |
|
1297 | + $w = ($maxW - (2 * $w)); |
|
1298 | 1298 | $texto = 'CNPJ / CPF'; |
1299 | 1299 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1300 | 1300 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1301 | 1301 | //Pegando valor do CPF/CNPJ |
1302 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1302 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1303 | 1303 | $texto = $this->pFormat( |
1304 | 1304 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1305 | 1305 | "###.###.###/####-##" |
1306 | 1306 | ); |
1307 | 1307 | } else { |
1308 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1308 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1309 | 1309 | $this->pFormat( |
1310 | 1310 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
1311 | 1311 | "###.###.###-##" |
@@ -1321,9 +1321,9 @@ discard block |
||
1321 | 1321 | if ($this->pNotaCancelada()) { |
1322 | 1322 | //101 Cancelamento |
1323 | 1323 | $x = 10; |
1324 | - $y = $this->hPrint-130; |
|
1324 | + $y = $this->hPrint - 130; |
|
1325 | 1325 | $h = 25; |
1326 | - $w = $maxW-(2*$x); |
|
1326 | + $w = $maxW - (2 * $x); |
|
1327 | 1327 | $this->pdf->SetTextColor(90, 90, 90); |
1328 | 1328 | $texto = "NFe CANCELADA"; |
1329 | 1329 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
@@ -1334,12 +1334,12 @@ discard block |
||
1334 | 1334 | if ($this->pNotaDPEC() || $this->tpEmis == 4) { |
1335 | 1335 | //DPEC |
1336 | 1336 | $x = 10; |
1337 | - $y = $this->hPrint-130; |
|
1337 | + $y = $this->hPrint - 130; |
|
1338 | 1338 | $h = 25; |
1339 | - $w = $maxW-(2*$x); |
|
1339 | + $w = $maxW - (2 * $x); |
|
1340 | 1340 | $this->pdf->SetTextColor(200, 200, 200); |
1341 | - $texto = "DANFE impresso em contingência -\n". |
|
1342 | - "DPEC regularmente recebido pela Receita\n". |
|
1341 | + $texto = "DANFE impresso em contingência -\n" . |
|
1342 | + "DPEC regularmente recebido pela Receita\n" . |
|
1343 | 1343 | "Federal do Brasil"; |
1344 | 1344 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
1345 | 1345 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1348,22 +1348,22 @@ discard block |
||
1348 | 1348 | if ($this->pNotaDenegada()) { |
1349 | 1349 | //110 301 302 Denegada |
1350 | 1350 | $x = 10; |
1351 | - $y = $this->hPrint-130; |
|
1351 | + $y = $this->hPrint - 130; |
|
1352 | 1352 | $h = 25; |
1353 | - $w = $maxW-(2*$x); |
|
1353 | + $w = $maxW - (2 * $x); |
|
1354 | 1354 | $this->pdf->SetTextColor(90, 90, 90); |
1355 | 1355 | $texto = "NFe USO DENEGADO"; |
1356 | 1356 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
1357 | 1357 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1358 | 1358 | $y += $h; |
1359 | 1359 | $h = 5; |
1360 | - $w = $maxW-(2*$x); |
|
1360 | + $w = $maxW - (2 * $x); |
|
1361 | 1361 | if (isset($this->infProt)) { |
1362 | 1362 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
1363 | 1363 | } else { |
1364 | 1364 | $xMotivo = ''; |
1365 | 1365 | } |
1366 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
1366 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
1367 | 1367 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
1368 | 1368 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1369 | 1369 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1372,29 +1372,29 @@ discard block |
||
1372 | 1372 | if ($tpAmb != 1) { |
1373 | 1373 | $x = 10; |
1374 | 1374 | if ($this->orientacao == 'P') { |
1375 | - $y = round($this->hPrint*2/3, 0); |
|
1375 | + $y = round($this->hPrint * 2 / 3, 0); |
|
1376 | 1376 | } else { |
1377 | - $y = round($this->hPrint/2, 0); |
|
1377 | + $y = round($this->hPrint / 2, 0); |
|
1378 | 1378 | } |
1379 | 1379 | $h = 5; |
1380 | - $w = $maxW-(2*$x); |
|
1380 | + $w = $maxW - (2 * $x); |
|
1381 | 1381 | $this->pdf->SetTextColor(90, 90, 90); |
1382 | 1382 | $texto = "SEM VALOR FISCAL"; |
1383 | 1383 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
1384 | 1384 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1385 | 1385 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
1386 | 1386 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
1387 | - $this->pTextBox($x, $y+14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1387 | + $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1388 | 1388 | $this->pdf->SetTextColor(0, 0, 0); |
1389 | 1389 | } else { |
1390 | 1390 | $x = 10; |
1391 | 1391 | if ($this->orientacao == 'P') { |
1392 | - $y = round($this->hPrint*2/3, 0); |
|
1392 | + $y = round($this->hPrint * 2 / 3, 0); |
|
1393 | 1393 | } else { |
1394 | - $y = round($this->hPrint/2, 0); |
|
1394 | + $y = round($this->hPrint / 2, 0); |
|
1395 | 1395 | }//fim orientacao |
1396 | 1396 | $h = 5; |
1397 | - $w = $maxW-(2*$x); |
|
1397 | + $w = $maxW - (2 * $x); |
|
1398 | 1398 | $this->pdf->SetTextColor(90, 90, 90); |
1399 | 1399 | //indicar FALTA DO PROTOCOLO se NFe não for em contingência |
1400 | 1400 | if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->pNotaDPEC()) { |
@@ -1404,7 +1404,7 @@ discard block |
||
1404 | 1404 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1405 | 1405 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
1406 | 1406 | $texto = "devido à problemas técnicos"; |
1407 | - $this->pTextBox($x, $y+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1407 | + $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1408 | 1408 | } else { |
1409 | 1409 | if (!isset($this->nfeProc)) { |
1410 | 1410 | if (!$this->pNotaDPEC()) { |
@@ -1415,9 +1415,9 @@ discard block |
||
1415 | 1415 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
1416 | 1416 | $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ"; |
1417 | 1417 | if (!$this->pNotaDPEC()) { |
1418 | - $this->pTextBox($x, $y+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1418 | + $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1419 | 1419 | } else { |
1420 | - $this->pTextBox($x, $y+25, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1420 | + $this->pTextBox($x, $y + 25, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1421 | 1421 | } |
1422 | 1422 | }//fim nefProc |
1423 | 1423 | }//fim tpEmis |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1453 | 1453 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1454 | 1454 | //NOME / RAZÃO SOCIAL |
1455 | - $w = round($maxW*0.61, 0); |
|
1455 | + $w = round($maxW * 0.61, 0); |
|
1456 | 1456 | $w1 = $w; |
1457 | 1457 | $y += 3; |
1458 | 1458 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1467,19 +1467,19 @@ discard block |
||
1467 | 1467 | } |
1468 | 1468 | //CNPJ / CPF |
1469 | 1469 | $x += $w; |
1470 | - $w = round($maxW*0.23, 0); |
|
1470 | + $w = round($maxW * 0.23, 0); |
|
1471 | 1471 | $w2 = $w; |
1472 | 1472 | $texto = 'CNPJ / CPF'; |
1473 | 1473 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1474 | 1474 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1475 | 1475 | //Pegando valor do CPF/CNPJ |
1476 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1476 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1477 | 1477 | $texto = $this->pFormat( |
1478 | 1478 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1479 | 1479 | "###.###.###/####-##" |
1480 | 1480 | ); |
1481 | 1481 | } else { |
1482 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1482 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1483 | 1483 | $this->pFormat( |
1484 | 1484 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
1485 | 1485 | "###.###.###-##" |
@@ -1489,15 +1489,15 @@ discard block |
||
1489 | 1489 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1490 | 1490 | //DATA DA EMISSÃO |
1491 | 1491 | $x += $w; |
1492 | - $w = $maxW-($w1+$w2); |
|
1492 | + $w = $maxW - ($w1 + $w2); |
|
1493 | 1493 | $wx = $w; |
1494 | 1494 | $texto = 'DATA DA EMISSÃO'; |
1495 | 1495 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1496 | 1496 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1497 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
1497 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
1498 | 1498 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
1499 | 1499 | if ($dEmi == '') { |
1500 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
1500 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
1501 | 1501 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
1502 | 1502 | $aDemi = explode('T', $dEmi); |
1503 | 1503 | $dEmi = $aDemi[0]; |
@@ -1510,7 +1510,7 @@ discard block |
||
1510 | 1510 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
1511 | 1511 | } |
1512 | 1512 | //ENDEREÇO |
1513 | - $w = round($maxW*0.47, 0); |
|
1513 | + $w = round($maxW * 0.47, 0); |
|
1514 | 1514 | $w1 = $w; |
1515 | 1515 | $y += $h; |
1516 | 1516 | $x = $oldX; |
@@ -1525,7 +1525,7 @@ discard block |
||
1525 | 1525 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1526 | 1526 | //BAIRRO / DISTRITO |
1527 | 1527 | $x += $w; |
1528 | - $w = round($maxW*0.21, 0); |
|
1528 | + $w = round($maxW * 0.21, 0); |
|
1529 | 1529 | $w2 = $w; |
1530 | 1530 | $texto = 'BAIRRO / DISTRITO'; |
1531 | 1531 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1535,12 +1535,12 @@ discard block |
||
1535 | 1535 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1536 | 1536 | //CEP |
1537 | 1537 | $x += $w; |
1538 | - $w = $maxW-$w1-$w2-$wx; |
|
1538 | + $w = $maxW - $w1 - $w2 - $wx; |
|
1539 | 1539 | $w2 = $w; |
1540 | 1540 | $texto = 'CEP'; |
1541 | 1541 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1542 | 1542 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1543 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1543 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1544 | 1544 | $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1545 | 1545 | $texto = $this->pFormat($texto, "#####-###"); |
1546 | 1546 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
@@ -1551,10 +1551,10 @@ discard block |
||
1551 | 1551 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
1552 | 1552 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1553 | 1553 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1554 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
1554 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
1555 | 1555 | $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue : ''; |
1556 | 1556 | if ($dSaiEnt == '') { |
1557 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
1557 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
1558 | 1558 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
1559 | 1559 | $aDsaient = explode('T', $dSaiEnt); |
1560 | 1560 | $dSaiEnt = $aDsaient[0]; |
@@ -1571,7 +1571,7 @@ discard block |
||
1571 | 1571 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1572 | 1572 | $texto = $this->dest->getElementsByTagName("xMun")->item(0)->nodeValue; |
1573 | 1573 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->dest->getElementsByTagName("xPais")->length > 0) { |
1574 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1574 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
1575 | 1575 | } |
1576 | 1576 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1577 | 1577 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1586,18 +1586,18 @@ discard block |
||
1586 | 1586 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1587 | 1587 | //FONE / FAX |
1588 | 1588 | $x += $w; |
1589 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
1589 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
1590 | 1590 | $w3 = $w; |
1591 | 1591 | $texto = 'FONE / FAX'; |
1592 | 1592 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1593 | 1593 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1594 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1594 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1595 | 1595 | $this->dest->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1596 | 1596 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
1597 | 1597 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1598 | 1598 | //INSCRIÇÃO ESTADUAL |
1599 | 1599 | $x += $w; |
1600 | - $w = $maxW -$w1-$wx-8-$w3; |
|
1600 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
1601 | 1601 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1602 | 1602 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1603 | 1603 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1611,10 +1611,10 @@ discard block |
||
1611 | 1611 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
1612 | 1612 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1613 | 1613 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1614 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
1614 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
1615 | 1615 | $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue : ''; |
1616 | 1616 | if ($hSaiEnt == '') { |
1617 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
1617 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
1618 | 1618 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
1619 | 1619 | $tsDhSaiEnt = $this->pConvertTime($dhSaiEnt); |
1620 | 1620 | if ($tsDhSaiEnt != '') { |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | protected function pFaturaDANFE($x, $y) |
1694 | 1694 | { |
1695 | 1695 | $linha = 1; |
1696 | - $h = 8+3; |
|
1696 | + $h = 8 + 3; |
|
1697 | 1697 | $oldx = $x; |
1698 | 1698 | $textoFatura = $this->pGetTextoFatura(); |
1699 | 1699 | //verificar se existem duplicatas |
@@ -1714,27 +1714,27 @@ discard block |
||
1714 | 1714 | $dupcont = 0; |
1715 | 1715 | $nFat = $this->dup->length; |
1716 | 1716 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
1717 | - $myH=6; |
|
1717 | + $myH = 6; |
|
1718 | 1718 | $myW = $this->wPrint; |
1719 | 1719 | if ($this->orientacao == 'L') { |
1720 | 1720 | $myW -= $this->wCanhoto; |
1721 | 1721 | } |
1722 | 1722 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
1723 | 1723 | $this->pTextBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
1724 | - $y+=$myH+1; |
|
1724 | + $y += $myH + 1; |
|
1725 | 1725 | } |
1726 | 1726 | if ($this->orientacao == 'P') { |
1727 | - $w = round($this->wPrint/7.018, 0)-1; |
|
1727 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
1728 | 1728 | } else { |
1729 | 1729 | $w = 28; |
1730 | 1730 | } |
1731 | 1731 | $increm = 1; |
1732 | 1732 | foreach ($this->dup as $k => $d) { |
1733 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
1733 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
1734 | 1734 | $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue : ''; |
1735 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
1735 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
1736 | 1736 | $this->pYmd2dmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) : ''; |
1737 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
1737 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
1738 | 1738 | 'R$ ' . number_format( |
1739 | 1739 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
1740 | 1740 | 2, |
@@ -1743,14 +1743,14 @@ discard block |
||
1743 | 1743 | ) : ''; |
1744 | 1744 | $h = 8; |
1745 | 1745 | $texto = ''; |
1746 | - if ($nDup!='0' && $nDup!='') { |
|
1746 | + if ($nDup != '0' && $nDup != '') { |
|
1747 | 1747 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1748 | 1748 | $this->pTextBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
1749 | 1749 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1750 | 1750 | $this->pTextBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
1751 | 1751 | } else { |
1752 | 1752 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1753 | - $this->pTextBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
1753 | + $this->pTextBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
1754 | 1754 | } |
1755 | 1755 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1756 | 1756 | $this->pTextBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | $this->pTextBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
1761 | 1761 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1762 | 1762 | $this->pTextBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
1763 | - $x += $w+$increm; |
|
1763 | + $x += $w + $increm; |
|
1764 | 1764 | $dupcont += 1; |
1765 | 1765 | if ($this->orientacao == 'P') { |
1766 | 1766 | $maxDupCont = 6; |
@@ -1782,10 +1782,10 @@ discard block |
||
1782 | 1782 | $y -= 9; |
1783 | 1783 | $linha--; |
1784 | 1784 | } |
1785 | - return ($y+$h); |
|
1785 | + return ($y + $h); |
|
1786 | 1786 | } else { |
1787 | 1787 | $linha = 0; |
1788 | - return ($y-2); |
|
1788 | + return ($y - 2); |
|
1789 | 1789 | } |
1790 | 1790 | } //fim da função faturaDANFE |
1791 | 1791 | |
@@ -1801,7 +1801,7 @@ discard block |
||
1801 | 1801 | protected function pagamentoDANFE($x, $y) |
1802 | 1802 | { |
1803 | 1803 | $linha = 1; |
1804 | - $h = 8+3; |
|
1804 | + $h = 8 + 3; |
|
1805 | 1805 | $oldx = $x; |
1806 | 1806 | //verificar se existem cobranças definidas |
1807 | 1807 | if (isset($this->detPag) && $this->detPag->length > 0) { |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | $dups = ""; |
1821 | 1821 | $dupcont = 0; |
1822 | 1822 | if ($this->orientacao == 'P') { |
1823 | - $w = round($this->wPrint/7.018, 0)-1; |
|
1823 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
1824 | 1824 | } else { |
1825 | 1825 | $w = 28; |
1826 | 1826 | } |
@@ -1830,16 +1830,16 @@ discard block |
||
1830 | 1830 | $maxDupCont = 8; |
1831 | 1831 | } |
1832 | 1832 | $increm = 1; |
1833 | - $formaPagamento = array('01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
1834 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
1835 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
1836 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'); |
|
1837 | - $bandeira = array('01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
1838 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
1833 | + $formaPagamento = array('01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
1834 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
1835 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
1836 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'); |
|
1837 | + $bandeira = array('01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
1838 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'); |
|
1839 | 1839 | foreach ($this->detPag as $k => $d) { |
1840 | 1840 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
1841 | 1841 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
1842 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
1842 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
1843 | 1843 | ? 'R$ ' . number_format( |
1844 | 1844 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
1845 | 1845 | 2, |
@@ -1850,7 +1850,7 @@ discard block |
||
1850 | 1850 | $texto = ''; |
1851 | 1851 | if (isset($formaPagamento[$fPag])) { |
1852 | 1852 | /*Exibir Item sem pagamento ou outros?*/ |
1853 | - if ($fPag=='90' || $fPag=='99') { |
|
1853 | + if ($fPag == '90' || $fPag == '99') { |
|
1854 | 1854 | continue; |
1855 | 1855 | } |
1856 | 1856 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1859,16 +1859,16 @@ discard block |
||
1859 | 1859 | $this->pTextBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
1860 | 1860 | } else { |
1861 | 1861 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
1862 | - $this->pTextBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
1862 | + $this->pTextBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
1863 | 1863 | } |
1864 | 1864 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
1865 | 1865 | $this->pTextBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
1866 | 1866 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
1867 | 1867 | $this->pTextBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
1868 | - $x += $w+$increm; |
|
1868 | + $x += $w + $increm; |
|
1869 | 1869 | $dupcont += 1; |
1870 | 1870 | |
1871 | - if ($dupcont>$maxDupCont) { |
|
1871 | + if ($dupcont > $maxDupCont) { |
|
1872 | 1872 | $y += 9; |
1873 | 1873 | $x = $oldx; |
1874 | 1874 | $dupcont = 0; |
@@ -1883,10 +1883,10 @@ discard block |
||
1883 | 1883 | $y -= 9; |
1884 | 1884 | $linha--; |
1885 | 1885 | } |
1886 | - return ($y+$h); |
|
1886 | + return ($y + $h); |
|
1887 | 1887 | } else { |
1888 | 1888 | $linha = 0; |
1889 | - return ($y-2); |
|
1889 | + return ($y - 2); |
|
1890 | 1890 | } |
1891 | 1891 | } //fim da função pagamentoDANFE |
1892 | 1892 | |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | } |
1999 | 1999 | $x = $this->pImpostoDanfeHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
2000 | 2000 | |
2001 | - return ($y+$h); |
|
2001 | + return ($y + $h); |
|
2002 | 2002 | } //fim impostoDANFE |
2003 | 2003 | |
2004 | 2004 | /** |
@@ -2026,13 +2026,13 @@ discard block |
||
2026 | 2026 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
2027 | 2027 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2028 | 2028 | //NOME / RAZÃO SOCIAL |
2029 | - $w1 = $maxW*0.29; |
|
2029 | + $w1 = $maxW * 0.29; |
|
2030 | 2030 | $y += 3; |
2031 | 2031 | $texto = 'NOME / RAZÃO SOCIAL'; |
2032 | 2032 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2033 | 2033 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2034 | 2034 | if (isset($this->transporta)) { |
2035 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
2035 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
2036 | 2036 | $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue : ''; |
2037 | 2037 | } else { |
2038 | 2038 | $texto = ''; |
@@ -2041,11 +2041,11 @@ discard block |
||
2041 | 2041 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2042 | 2042 | //FRETE POR CONTA |
2043 | 2043 | $x += $w1; |
2044 | - $w2 = $maxW*0.15; |
|
2044 | + $w2 = $maxW * 0.15; |
|
2045 | 2045 | $texto = 'FRETE'; |
2046 | 2046 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2047 | 2047 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2048 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
2048 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
2049 | 2049 | $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue : '0'; |
2050 | 2050 | switch ($tipoFrete) { |
2051 | 2051 | case 0: |
@@ -2075,7 +2075,7 @@ discard block |
||
2075 | 2075 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2076 | 2076 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2077 | 2077 | if (isset($this->veicTransp)) { |
2078 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
2078 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
2079 | 2079 | $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue : ''; |
2080 | 2080 | } else { |
2081 | 2081 | $texto = ''; |
@@ -2088,10 +2088,10 @@ discard block |
||
2088 | 2088 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2089 | 2089 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2090 | 2090 | if (isset($this->veicTransp)) { |
2091 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
2091 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
2092 | 2092 | $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
2093 | 2093 | } elseif (isset($this->reboque)) { |
2094 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
2094 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
2095 | 2095 | $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
2096 | 2096 | } else { |
2097 | 2097 | $texto = ''; |
@@ -2100,15 +2100,15 @@ discard block |
||
2100 | 2100 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2101 | 2101 | //UF |
2102 | 2102 | $x += $w2; |
2103 | - $w3 = round($maxW*0.04, 0); |
|
2103 | + $w3 = round($maxW * 0.04, 0); |
|
2104 | 2104 | $texto = 'UF'; |
2105 | 2105 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2106 | 2106 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2107 | 2107 | if (isset($this->veicTransp)) { |
2108 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2108 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2109 | 2109 | $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
2110 | 2110 | } elseif (isset($this->reboque)) { |
2111 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2111 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2112 | 2112 | $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
2113 | 2113 | } else { |
2114 | 2114 | $texto = ''; |
@@ -2117,18 +2117,18 @@ discard block |
||
2117 | 2117 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2118 | 2118 | //CNPJ / CPF |
2119 | 2119 | $x += $w3; |
2120 | - $w = $maxW-($w1+3*$w2+$w3); |
|
2120 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
2121 | 2121 | $texto = 'CNPJ / CPF'; |
2122 | 2122 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2123 | 2123 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2124 | 2124 | if (isset($this->transporta)) { |
2125 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
2125 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
2126 | 2126 | $this->pFormat( |
2127 | 2127 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
2128 | 2128 | "##.###.###/####-##" |
2129 | 2129 | ) : ''; |
2130 | 2130 | if ($texto == '') { |
2131 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
2131 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
2132 | 2132 | $this->pFormat( |
2133 | 2133 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
2134 | 2134 | "###.###.###-##" |
@@ -2144,12 +2144,12 @@ discard block |
||
2144 | 2144 | $y += $h; |
2145 | 2145 | $x = $oldX; |
2146 | 2146 | $h = 7; |
2147 | - $w1 = $maxW*0.44; |
|
2147 | + $w1 = $maxW * 0.44; |
|
2148 | 2148 | $texto = 'ENDEREÇO'; |
2149 | 2149 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2150 | 2150 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2151 | 2151 | if (isset($this->transporta)) { |
2152 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
2152 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
2153 | 2153 | $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue : ''; |
2154 | 2154 | } else { |
2155 | 2155 | $texto = ''; |
@@ -2158,12 +2158,12 @@ discard block |
||
2158 | 2158 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2159 | 2159 | //MUNICÍPIO |
2160 | 2160 | $x += $w1; |
2161 | - $w2 = round($maxW*0.30, 0); |
|
2161 | + $w2 = round($maxW * 0.30, 0); |
|
2162 | 2162 | $texto = 'MUNICÍPIO'; |
2163 | 2163 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2164 | 2164 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2165 | 2165 | if (isset($this->transporta)) { |
2166 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
2166 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
2167 | 2167 | $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue : ''; |
2168 | 2168 | } else { |
2169 | 2169 | $texto = ''; |
@@ -2172,12 +2172,12 @@ discard block |
||
2172 | 2172 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2173 | 2173 | //UF |
2174 | 2174 | $x += $w2; |
2175 | - $w3 = round($maxW*0.04, 0); |
|
2175 | + $w3 = round($maxW * 0.04, 0); |
|
2176 | 2176 | $texto = 'UF'; |
2177 | 2177 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2178 | 2178 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2179 | 2179 | if (isset($this->transporta)) { |
2180 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2180 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
2181 | 2181 | $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
2182 | 2182 | } else { |
2183 | 2183 | $texto = ''; |
@@ -2186,13 +2186,13 @@ discard block |
||
2186 | 2186 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2187 | 2187 | //INSCRIÇÃO ESTADUAL |
2188 | 2188 | $x += $w3; |
2189 | - $w = $maxW-($w1+$w2+$w3); |
|
2189 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
2190 | 2190 | $texto = 'INSCRIÇÃO ESTADUAL'; |
2191 | 2191 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2192 | 2192 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2193 | 2193 | $texto = ''; |
2194 | 2194 | if (isset($this->transporta)) { |
2195 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2195 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2196 | 2196 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
2197 | 2197 | } |
2198 | 2198 | } |
@@ -2205,16 +2205,16 @@ discard block |
||
2205 | 2205 | $marca = ''; |
2206 | 2206 | $numero = ''; |
2207 | 2207 | $texto = ''; |
2208 | - $pesoBruto=0; |
|
2209 | - $pesoLiquido=0; |
|
2208 | + $pesoBruto = 0; |
|
2209 | + $pesoLiquido = 0; |
|
2210 | 2210 | foreach ($volumes as $volume) { |
2211 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2211 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2212 | 2212 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
2213 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2213 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2214 | 2214 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
2215 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2215 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2216 | 2216 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
2217 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2217 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2218 | 2218 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
2219 | 2219 | if ($texto != $especie && $especie != '') { |
2220 | 2220 | //tem várias especies |
@@ -2222,7 +2222,7 @@ discard block |
||
2222 | 2222 | } else { |
2223 | 2223 | $especie = $texto; |
2224 | 2224 | } |
2225 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2225 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2226 | 2226 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
2227 | 2227 | if ($texto != $marca && $marca != '') { |
2228 | 2228 | //tem várias especies |
@@ -2230,7 +2230,7 @@ discard block |
||
2230 | 2230 | } else { |
2231 | 2231 | $marca = $texto; |
2232 | 2232 | } |
2233 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
2233 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
2234 | 2234 | $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue : ''; |
2235 | 2235 | if ($texto != $numero && $numero != '') { |
2236 | 2236 | //tem várias especies |
@@ -2245,7 +2245,7 @@ discard block |
||
2245 | 2245 | $y += $h; |
2246 | 2246 | $x = $oldX; |
2247 | 2247 | $h = 7; |
2248 | - $w1 = round($maxW*0.10, 0); |
|
2248 | + $w1 = round($maxW * 0.10, 0); |
|
2249 | 2249 | $texto = 'QUANTIDADE'; |
2250 | 2250 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2251 | 2251 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | } |
2257 | 2257 | //ESPÉCIE |
2258 | 2258 | $x += $w1; |
2259 | - $w2 = round($maxW*0.17, 0); |
|
2259 | + $w2 = round($maxW * 0.17, 0); |
|
2260 | 2260 | $texto = 'ESPÉCIE'; |
2261 | 2261 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2262 | 2262 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2268,7 +2268,7 @@ discard block |
||
2268 | 2268 | $texto = 'MARCA'; |
2269 | 2269 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2270 | 2270 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2271 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2271 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2272 | 2272 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
2273 | 2273 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
2274 | 2274 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2283 | 2283 | //PESO BRUTO |
2284 | 2284 | $x += $w2; |
2285 | - $w3 = round($maxW*0.20, 0); |
|
2285 | + $w3 = round($maxW * 0.20, 0); |
|
2286 | 2286 | $texto = 'PESO BRUTO'; |
2287 | 2287 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2288 | 2288 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2295,7 +2295,7 @@ discard block |
||
2295 | 2295 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2296 | 2296 | //PESO LÍQUIDO |
2297 | 2297 | $x += $w3; |
2298 | - $w = $maxW -($w1+3*$w2+$w3); |
|
2298 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
2299 | 2299 | $texto = 'PESO LÍQUIDO'; |
2300 | 2300 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2301 | 2301 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2306,7 +2306,7 @@ discard block |
||
2306 | 2306 | } |
2307 | 2307 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
2308 | 2308 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2309 | - return ($y+$h); |
|
2309 | + return ($y + $h); |
|
2310 | 2310 | } //fim transporteDANFE |
2311 | 2311 | |
2312 | 2312 | |
@@ -2318,7 +2318,7 @@ discard block |
||
2318 | 2318 | return ""; |
2319 | 2319 | } |
2320 | 2320 | $valor_original = $valor_original->nodeValue; |
2321 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2321 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2322 | 2322 | |
2323 | 2323 | if ($valor != "") { |
2324 | 2324 | return sprintf($formato, $valor); |
@@ -2362,13 +2362,13 @@ discard block |
||
2362 | 2362 | $impostos .= $this->pDescricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
2363 | 2363 | $impostos .= $this->pDescricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
2364 | 2364 | } |
2365 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) ? |
|
2365 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) ? |
|
2366 | 2366 | substr($this->pAnfavea($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), 0, 500) : ''; |
2367 | - if (! empty($infAdProd)) { |
|
2367 | + if (!empty($infAdProd)) { |
|
2368 | 2368 | $infAdProd = trim($infAdProd); |
2369 | 2369 | $infAdProd .= ' '; |
2370 | 2370 | } |
2371 | - $loteTxt =''; |
|
2371 | + $loteTxt = ''; |
|
2372 | 2372 | $rastro = $prod->getElementsByTagName("med"); |
2373 | 2373 | if (!isset($rastro)) { |
2374 | 2374 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2384,14 +2384,14 @@ discard block |
||
2384 | 2384 | $i++; |
2385 | 2385 | } |
2386 | 2386 | if ($loteTxt != '') { |
2387 | - $loteTxt.= ' '; |
|
2387 | + $loteTxt .= ' '; |
|
2388 | 2388 | } |
2389 | 2389 | } |
2390 | 2390 | //NT2013.006 FCI |
2391 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2392 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
2393 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
2394 | - $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
2391 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2392 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
2393 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
2394 | + $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
2395 | 2395 | //decodifica os caracteres html no xml |
2396 | 2396 | $texto = html_entity_decode($texto); |
2397 | 2397 | if ($this->descProdQuebraLinha) { |
@@ -2441,104 +2441,104 @@ discard block |
||
2441 | 2441 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
2442 | 2442 | //CÓDIGO PRODUTO |
2443 | 2443 | $texto = "CÓDIGO PRODUTO"; |
2444 | - $w1 = round($w*0.09, 0); |
|
2444 | + $w1 = round($w * 0.09, 0); |
|
2445 | 2445 | $h = 4; |
2446 | 2446 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2447 | 2447 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2448 | - $this->pdf->Line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
2448 | + $this->pdf->Line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
2449 | 2449 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
2450 | 2450 | $x += $w1; |
2451 | - $w2 = round($w*0.28, 0); |
|
2451 | + $w2 = round($w * 0.28, 0); |
|
2452 | 2452 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
2453 | 2453 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2454 | 2454 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2455 | - $this->pdf->Line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
2455 | + $this->pdf->Line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
2456 | 2456 | //NCM/SH |
2457 | 2457 | $x += $w2; |
2458 | - $w3 = round($w*0.06, 0); |
|
2458 | + $w3 = round($w * 0.06, 0); |
|
2459 | 2459 | $texto = 'NCM/SH'; |
2460 | 2460 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2461 | 2461 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2462 | - $this->pdf->Line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
2462 | + $this->pdf->Line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
2463 | 2463 | //O/CST ou O/CSOSN |
2464 | 2464 | $x += $w3; |
2465 | - $w4 = round($w*0.05, 0); |
|
2466 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
2465 | + $w4 = round($w * 0.05, 0); |
|
2466 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
2467 | 2467 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
2468 | - $texto = 'O/CST';//Regime Normal |
|
2468 | + $texto = 'O/CST'; //Regime Normal |
|
2469 | 2469 | } |
2470 | 2470 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2471 | 2471 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2472 | - $this->pdf->Line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
2472 | + $this->pdf->Line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
2473 | 2473 | //CFOP |
2474 | 2474 | $x += $w4; |
2475 | - $w5 = round($w*0.04, 0); |
|
2475 | + $w5 = round($w * 0.04, 0); |
|
2476 | 2476 | $texto = 'CFOP'; |
2477 | 2477 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2478 | 2478 | $this->pTextBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2479 | - $this->pdf->Line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
2479 | + $this->pdf->Line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
2480 | 2480 | //UN |
2481 | 2481 | $x += $w5; |
2482 | - $w6 = round($w*0.03, 0); |
|
2482 | + $w6 = round($w * 0.03, 0); |
|
2483 | 2483 | $texto = 'UN'; |
2484 | 2484 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2485 | 2485 | $this->pTextBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2486 | - $this->pdf->Line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
2486 | + $this->pdf->Line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
2487 | 2487 | //QUANT |
2488 | 2488 | $x += $w6; |
2489 | - $w7 = round($w*0.07, 0); |
|
2489 | + $w7 = round($w * 0.07, 0); |
|
2490 | 2490 | $texto = 'QUANT'; |
2491 | 2491 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2492 | 2492 | $this->pTextBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2493 | - $this->pdf->Line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
2493 | + $this->pdf->Line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
2494 | 2494 | //VALOR UNIT |
2495 | 2495 | $x += $w7; |
2496 | - $w8 = round($w*0.06, 0); |
|
2496 | + $w8 = round($w * 0.06, 0); |
|
2497 | 2497 | $texto = 'VALOR UNIT'; |
2498 | 2498 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2499 | 2499 | $this->pTextBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2500 | - $this->pdf->Line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
2500 | + $this->pdf->Line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
2501 | 2501 | //VALOR TOTAL |
2502 | 2502 | $x += $w8; |
2503 | - $w9 = round($w*0.06, 0); |
|
2503 | + $w9 = round($w * 0.06, 0); |
|
2504 | 2504 | $texto = 'VALOR TOTAL'; |
2505 | 2505 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2506 | 2506 | $this->pTextBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2507 | - $this->pdf->Line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
2507 | + $this->pdf->Line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
2508 | 2508 | //B.CÁLC ICMS |
2509 | 2509 | $x += $w9; |
2510 | - $w10 = round($w*0.06, 0); |
|
2510 | + $w10 = round($w * 0.06, 0); |
|
2511 | 2511 | $texto = 'B.CÁLC ICMS'; |
2512 | 2512 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2513 | 2513 | $this->pTextBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2514 | - $this->pdf->Line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
2514 | + $this->pdf->Line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
2515 | 2515 | //VALOR ICMS |
2516 | 2516 | $x += $w10; |
2517 | - $w11 = round($w*0.06, 0); |
|
2517 | + $w11 = round($w * 0.06, 0); |
|
2518 | 2518 | $texto = 'VALOR ICMS'; |
2519 | 2519 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2520 | 2520 | $this->pTextBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2521 | - $this->pdf->Line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
2521 | + $this->pdf->Line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
2522 | 2522 | //VALOR IPI |
2523 | 2523 | $x += $w11; |
2524 | - $w12 = round($w*0.05, 0); |
|
2524 | + $w12 = round($w * 0.05, 0); |
|
2525 | 2525 | $texto = 'VALOR IPI'; |
2526 | 2526 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2527 | 2527 | $this->pTextBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2528 | - $this->pdf->Line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
2528 | + $this->pdf->Line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
2529 | 2529 | //ALÍQ. ICMS |
2530 | 2530 | $x += $w12; |
2531 | - $w13 = round($w*0.035, 0); |
|
2531 | + $w13 = round($w * 0.035, 0); |
|
2532 | 2532 | $texto = 'ALÍQ. ICMS'; |
2533 | 2533 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2534 | 2534 | $this->pTextBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2535 | - $this->pdf->Line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
2535 | + $this->pdf->Line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
2536 | 2536 | //ALÍQ. IPI |
2537 | 2537 | $x += $w13; |
2538 | - $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13); |
|
2538 | + $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13); |
|
2539 | 2539 | $texto = 'ALÍQ. IPI'; |
2540 | 2540 | $this->pTextBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2541 | - $this->pdf->Line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
2541 | + $this->pdf->Line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
2542 | 2542 | $y += 5; |
2543 | 2543 | //################################################################################## |
2544 | 2544 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2555,7 +2555,7 @@ discard block |
||
2555 | 2555 | $IPI = $imposto->getElementsByTagName("IPI")->item(0); |
2556 | 2556 | $textoProduto = $this->pDescricaoProduto($thisItem); |
2557 | 2557 | $linhaDescr = $this->pGetNumLines($textoProduto, $w2, $aFont); |
2558 | - $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2); |
|
2558 | + $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2); |
|
2559 | 2559 | $hUsado += $h; |
2560 | 2560 | if ($pag != $totpag) { |
2561 | 2561 | if ($hUsado >= $hmax && $i < $totItens) { |
@@ -2565,11 +2565,11 @@ discard block |
||
2565 | 2565 | break; |
2566 | 2566 | } |
2567 | 2567 | } |
2568 | - $y_linha=$y+$h; |
|
2568 | + $y_linha = $y + $h; |
|
2569 | 2569 | // linha entre itens |
2570 | 2570 | $this->pdf->DashedHLine($oldX, $y_linha, $w, 0.1, 120); |
2571 | 2571 | //corrige o x |
2572 | - $x=$oldX; |
|
2572 | + $x = $oldX; |
|
2573 | 2573 | //codigo do produto |
2574 | 2574 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
2575 | 2575 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, ''); |
@@ -2582,16 +2582,16 @@ discard block |
||
2582 | 2582 | } |
2583 | 2583 | $x += $w2; |
2584 | 2584 | //NCM |
2585 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2585 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2586 | 2586 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
2587 | 2587 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2588 | 2588 | $x += $w3; |
2589 | 2589 | //CST |
2590 | 2590 | if (isset($ICMS)) { |
2591 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
2592 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
2593 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
2594 | - $texto = $origem.$cst.$csosn; |
|
2591 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
2592 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
2593 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
2594 | + $texto = $origem . $cst . $csosn; |
|
2595 | 2595 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2596 | 2596 | } |
2597 | 2597 | //CFOP |
@@ -2625,7 +2625,7 @@ discard block |
||
2625 | 2625 | //Valor da Base de calculo |
2626 | 2626 | $x += $w9; |
2627 | 2627 | if (isset($ICMS)) { |
2628 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
2628 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
2629 | 2629 | number_format( |
2630 | 2630 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
2631 | 2631 | 2, |
@@ -2637,7 +2637,7 @@ discard block |
||
2637 | 2637 | //Valor do ICMS |
2638 | 2638 | $x += $w10; |
2639 | 2639 | if (isset($ICMS)) { |
2640 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
2640 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
2641 | 2641 | number_format( |
2642 | 2642 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
2643 | 2643 | 2, |
@@ -2649,8 +2649,8 @@ discard block |
||
2649 | 2649 | //Valor do IPI |
2650 | 2650 | $x += $w11; |
2651 | 2651 | if (isset($IPI)) { |
2652 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
2653 | - number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") :''; |
|
2652 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
2653 | + number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
|
2654 | 2654 | } else { |
2655 | 2655 | $texto = ''; |
2656 | 2656 | } |
@@ -2658,7 +2658,7 @@ discard block |
||
2658 | 2658 | // %ICMS |
2659 | 2659 | $x += $w12; |
2660 | 2660 | if (isset($ICMS)) { |
2661 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
2661 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
2662 | 2662 | number_format( |
2663 | 2663 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
2664 | 2664 | 2, |
@@ -2670,7 +2670,7 @@ discard block |
||
2670 | 2670 | //%IPI |
2671 | 2671 | $x += $w13; |
2672 | 2672 | if (isset($IPI)) { |
2673 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
2673 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
2674 | 2674 | number_format($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
2675 | 2675 | } else { |
2676 | 2676 | $texto = ''; |
@@ -2695,7 +2695,7 @@ discard block |
||
2695 | 2695 | $i++; |
2696 | 2696 | } |
2697 | 2697 | } |
2698 | - return $oldY+$hmax; |
|
2698 | + return $oldY + $hmax; |
|
2699 | 2699 | } |
2700 | 2700 | |
2701 | 2701 | |
@@ -2729,7 +2729,7 @@ discard block |
||
2729 | 2729 | |
2730 | 2730 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
2731 | 2731 | |
2732 | - $w1 = round($w*0.09, 0); |
|
2732 | + $w1 = round($w * 0.09, 0); |
|
2733 | 2733 | |
2734 | 2734 | // Tabela Renavam Combustivel |
2735 | 2735 | $renavamCombustivel = array( |
@@ -2828,54 +2828,54 @@ discard block |
||
2828 | 2828 | |
2829 | 2829 | $yVeic = $y + $h; |
2830 | 2830 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
2831 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2831 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2832 | 2832 | $yVeic += $h; |
2833 | 2833 | $texto = 'Cor...................: ' . $veiculoCor; |
2834 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2834 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2835 | 2835 | $yVeic += $h; |
2836 | 2836 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
2837 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2837 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2838 | 2838 | $yVeic += $h; |
2839 | 2839 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
2840 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2840 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2841 | 2841 | $yVeic += $h; |
2842 | 2842 | $texto = 'Tipo.................: ' . array_key_exists(intval($veiculoTipo), $renavamTiposVeiculos) ? $renavamTiposVeiculos[intval($veiculoTipo)] : $veiculoTipo; |
2843 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2843 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2844 | 2844 | $yVeic = $y + $h; |
2845 | 2845 | $xVeic = $x + 65; |
2846 | 2846 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
2847 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2847 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2848 | 2848 | $yVeic += $h; |
2849 | 2849 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
2850 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2850 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2851 | 2851 | $yVeic += $h; |
2852 | 2852 | $texto = 'HP.....................: ' . $veiculoHp; |
2853 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2853 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2854 | 2854 | $yVeic += $h; |
2855 | 2855 | $texto = 'Placa.................: ' . $veiculoPlaca; |
2856 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2856 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2857 | 2857 | $yVeic += $h; |
2858 | 2858 | $texto = 'Tipo Pintura......: ' . array_key_exists($veiculoTipoPintura, $renavamTipoPintura) ? $renavamTipoPintura[$veiculoTipoPintura] : $veiculoTipoPintura; |
2859 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2859 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2860 | 2860 | $yVeic = $y + $h; |
2861 | 2861 | $xVeic = $xVeic + 55; |
2862 | 2862 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
2863 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2863 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2864 | 2864 | $yVeic += $h; |
2865 | 2865 | $texto = 'Especie..................: ' . array_key_exists(intval($veiculoEspecie), $renavamEspecie) ? $renavamEspecie[intval($veiculoEspecie)] : intval($veiculoEspecie); |
2866 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2866 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2867 | 2867 | $yVeic += $h; |
2868 | 2868 | $texto = 'Combustivel..........: ' . array_key_exists(intval($veiculoCombustivel), $renavamCombustivel) ? $renavamCombustivel[intval($veiculoCombustivel)] : intval($veiculoCombustivel); |
2869 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2869 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2870 | 2870 | $yVeic += $h; |
2871 | 2871 | $texto = 'Serial.....................: ' . $veiculoSerial; |
2872 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2872 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2873 | 2873 | $yVeic += $h; |
2874 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
2875 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2874 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
2875 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2876 | 2876 | $yVeic += $h; |
2877 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
2878 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2877 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
2878 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2879 | 2879 | } |
2880 | 2880 | |
2881 | 2881 | /** |
@@ -2899,12 +2899,12 @@ discard block |
||
2899 | 2899 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2900 | 2900 | //INSCRIÇÃO MUNICIPAL |
2901 | 2901 | $y += 3; |
2902 | - $w = round($this->wPrint*0.23, 0); |
|
2902 | + $w = round($this->wPrint * 0.23, 0); |
|
2903 | 2903 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
2904 | 2904 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2905 | 2905 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2906 | 2906 | //inscrição municipal |
2907 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
2907 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
2908 | 2908 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
2909 | 2909 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
2910 | 2910 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -2914,7 +2914,7 @@ discard block |
||
2914 | 2914 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2915 | 2915 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2916 | 2916 | if (isset($this->ISSQNtot)) { |
2917 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
2917 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
2918 | 2918 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
2919 | 2919 | $texto = number_format($texto, 2, ",", "."); |
2920 | 2920 | } else { |
@@ -2928,9 +2928,9 @@ discard block |
||
2928 | 2928 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2929 | 2929 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2930 | 2930 | if (isset($this->ISSQNtot)) { |
2931 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
2931 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
2932 | 2932 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
2933 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
2933 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
2934 | 2934 | } else { |
2935 | 2935 | $texto = ''; |
2936 | 2936 | } |
@@ -2941,21 +2941,21 @@ discard block |
||
2941 | 2941 | if ($this->orientacao == 'P') { |
2942 | 2942 | $w = $this->wPrint - (3 * $w); |
2943 | 2943 | } else { |
2944 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
2944 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
2945 | 2945 | } |
2946 | 2946 | $texto = 'VALOR TOTAL DO ISSQN'; |
2947 | 2947 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
2948 | 2948 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2949 | 2949 | if (isset($this->ISSQNtot)) { |
2950 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
2950 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
2951 | 2951 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
2952 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
2952 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
2953 | 2953 | } else { |
2954 | 2954 | $texto = ''; |
2955 | 2955 | } |
2956 | 2956 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
2957 | 2957 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2958 | - return ($y+$h+1); |
|
2958 | + return ($y + $h + 1); |
|
2959 | 2959 | } |
2960 | 2960 | |
2961 | 2961 | /** |
@@ -2976,7 +2976,7 @@ discard block |
||
2976 | 2976 | if ($this->orientacao == 'P') { |
2977 | 2977 | $w = $this->wPrint; |
2978 | 2978 | } else { |
2979 | - $w = $this->wPrint-$this->wCanhoto; |
|
2979 | + $w = $this->wPrint - $this->wCanhoto; |
|
2980 | 2980 | } |
2981 | 2981 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
2982 | 2982 | $this->pTextBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2992,15 +2992,15 @@ discard block |
||
2992 | 2992 | //$this->textoAdic com o texto completo do campo |
2993 | 2993 | $y += 1; |
2994 | 2994 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
2995 | - $this->pTextBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
2995 | + $this->pTextBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
2996 | 2996 | //RESERVADO AO FISCO |
2997 | 2997 | $texto = "RESERVADO AO FISCO"; |
2998 | 2998 | $x += $w; |
2999 | 2999 | $y -= 1; |
3000 | 3000 | if ($this->orientacao == 'P') { |
3001 | - $w = $this->wPrint-$w; |
|
3001 | + $w = $this->wPrint - $w; |
|
3002 | 3002 | } else { |
3003 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
3003 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
3004 | 3004 | } |
3005 | 3005 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'); |
3006 | 3006 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3039,8 +3039,8 @@ discard block |
||
3039 | 3039 | } |
3040 | 3040 | $y += 2; |
3041 | 3041 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
3042 | - $this->pTextBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
3043 | - return $y+$h; |
|
3042 | + $this->pTextBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
3043 | + return $y + $h; |
|
3044 | 3044 | } |
3045 | 3045 | |
3046 | 3046 | /** |
@@ -3058,13 +3058,13 @@ discard block |
||
3058 | 3058 | if ($this->orientacao == 'P') { |
3059 | 3059 | $w = $this->wPrint; |
3060 | 3060 | } else { |
3061 | - $w = $this->wPrint-$this->wCanhoto; |
|
3061 | + $w = $this->wPrint - $this->wCanhoto; |
|
3062 | 3062 | $x = $this->wCanhoto; |
3063 | 3063 | } |
3064 | 3064 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
3065 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s'); |
|
3065 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s'); |
|
3066 | 3066 | $this->pTextBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
3067 | - $texto = $this->creditos . " Powered by NFePHP"; |
|
3067 | + $texto = $this->creditos . " Powered by NFePHP"; |
|
3068 | 3068 | $this->pTextBox($x, $y, $w, 0, $texto, $aFont, 'T', 'R', false, ''); |
3069 | 3069 | } |
3070 | 3070 | |
@@ -3117,9 +3117,9 @@ discard block |
||
3117 | 3117 | } else { |
3118 | 3118 | //linha separadora do canhoto - 238 |
3119 | 3119 | //posicao altura |
3120 | - $y = $this->wPrint-85; |
|
3120 | + $y = $this->wPrint - 85; |
|
3121 | 3121 | //altura |
3122 | - $w = $this->wPrint-85-24; |
|
3122 | + $w = $this->wPrint - 85 - 24; |
|
3123 | 3123 | } |
3124 | 3124 | $h = 10; |
3125 | 3125 | //desenha caixa |
@@ -3142,21 +3142,21 @@ discard block |
||
3142 | 3142 | $texto .= "AO LADO"; |
3143 | 3143 | } |
3144 | 3144 | $texto .= ". EMISSÃO: "; |
3145 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3145 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3146 | 3146 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3147 | 3147 | if ($dEmi == '') { |
3148 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3148 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3149 | 3149 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3150 | 3150 | $aDemi = explode('T', $dEmi); |
3151 | 3151 | $dEmi = $aDemi[0]; |
3152 | 3152 | } |
3153 | - $texto .= $this->pYmd2dmy($dEmi) ." "; |
|
3153 | + $texto .= $this->pYmd2dmy($dEmi) . " "; |
|
3154 | 3154 | $texto .= "VALOR TOTAL: R$ "; |
3155 | 3155 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
3156 | 3156 | $texto .= "DESTINATÁRIO: "; |
3157 | 3157 | $texto .= $destinatario; |
3158 | 3158 | if ($this->orientacao == 'P') { |
3159 | - $this->pTextBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
3159 | + $this->pTextBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
3160 | 3160 | $x1 = $x + $w; |
3161 | 3161 | $w1 = $this->wPrint - $w; |
3162 | 3162 | $texto = "NF-e"; |
@@ -3169,12 +3169,12 @@ discard block |
||
3169 | 3169 | //DATA DE RECEBIMENTO |
3170 | 3170 | $texto = "DATA DE RECEBIMENTO"; |
3171 | 3171 | $y += $h; |
3172 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
3172 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
3173 | 3173 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
3174 | 3174 | $this->pTextBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3175 | 3175 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3176 | 3176 | $x += $w2; |
3177 | - $w3 = $w-$w2; |
|
3177 | + $w3 = $w - $w2; |
|
3178 | 3178 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3179 | 3179 | $this->pTextBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3180 | 3180 | $x = $oldX; |
@@ -3184,7 +3184,7 @@ discard block |
||
3184 | 3184 | return $y; |
3185 | 3185 | } else { |
3186 | 3186 | $x--; |
3187 | - $x = $this->pTextBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
3187 | + $x = $this->pTextBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
3188 | 3188 | //NUMERO DA NOTA FISCAL LOGO NFE |
3189 | 3189 | $w1 = 18; |
3190 | 3190 | $x1 = $oldX; |
@@ -3198,18 +3198,18 @@ discard block |
||
3198 | 3198 | $this->pTextBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
3199 | 3199 | //DATA DO RECEBIMENTO |
3200 | 3200 | $texto = "DATA DO RECEBIMENTO"; |
3201 | - $y = $this->wPrint-85; |
|
3201 | + $y = $this->wPrint - 85; |
|
3202 | 3202 | $x = 12; |
3203 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
3203 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
3204 | 3204 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
3205 | 3205 | $this->pTextBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3206 | 3206 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3207 | 3207 | $y -= $w2; |
3208 | - $w3 = $w-$w2; |
|
3208 | + $w3 = $w - $w2; |
|
3209 | 3209 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3210 | 3210 | $aFont = array('font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''); |
3211 | 3211 | $x = $this->pTextBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3212 | - $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint-20, 67); |
|
3212 | + $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint - 20, 67); |
|
3213 | 3213 | return $x; |
3214 | 3214 | } |
3215 | 3215 | } |
@@ -3226,13 +3226,13 @@ discard block |
||
3226 | 3226 | { |
3227 | 3227 | $saida = ""; |
3228 | 3228 | if (isset($this->compra)) { |
3229 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3229 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3230 | 3230 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
3231 | 3231 | } |
3232 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3232 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3233 | 3233 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
3234 | 3234 | } |
3235 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3235 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3236 | 3236 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
3237 | 3237 | } |
3238 | 3238 | } |
@@ -3258,21 +3258,21 @@ discard block |
||
3258 | 3258 | if ($vICMS > 0) { |
3259 | 3259 | $vICMS = 1; |
3260 | 3260 | } |
3261 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
3261 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
3262 | 3262 | if ($icmss > 0) { |
3263 | 3263 | $icmss = 1; |
3264 | 3264 | } |
3265 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3265 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3266 | 3266 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3267 | 3267 | if ($dEmi == '') { |
3268 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3268 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3269 | 3269 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3270 | 3270 | $aDemi = explode('T', $dEmi); |
3271 | 3271 | $dEmi = $aDemi[0]; |
3272 | 3272 | } |
3273 | 3273 | $dd = $dEmi; |
3274 | 3274 | $rpos = strrpos($dd, '-'); |
3275 | - $dd = substr($dd, $rpos +1); |
|
3275 | + $dd = substr($dd, $rpos + 1); |
|
3276 | 3276 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
3277 | 3277 | $chave = $chave . $this->pModulo11($chave); |
3278 | 3278 | return $chave; |
@@ -3293,7 +3293,7 @@ discard block |
||
3293 | 3293 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
3294 | 3294 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
3295 | 3295 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
3296 | - $saida=''; |
|
3296 | + $saida = ''; |
|
3297 | 3297 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
3298 | 3298 | if (0 === $nfRefs->length) { |
3299 | 3299 | return $saida; |
@@ -3309,7 +3309,7 @@ discard block |
||
3309 | 3309 | foreach ($refNFe as $chave_acessoRef) { |
3310 | 3310 | $chave_acesso = $chave_acessoRef->nodeValue; |
3311 | 3311 | $chave_acessoF = $this->pFormat($chave_acesso, $this->formatoChave); |
3312 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
3312 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
3313 | 3313 | $cnpj = $this->pFormat(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3314 | 3314 | $serie = substr($chave_acesso, 22, 3); |
3315 | 3315 | $numero = substr($chave_acesso, 25, 9); |
@@ -3330,7 +3330,7 @@ discard block |
||
3330 | 3330 | foreach ($refCTe as $chave_acessoRef) { |
3331 | 3331 | $chave_acesso = $chave_acessoRef->nodeValue; |
3332 | 3332 | $chave_acessoF = $this->pFormat($chave_acesso, $this->formatoChave); |
3333 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
3333 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
3334 | 3334 | $cnpj = $this->pFormat(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3335 | 3335 | $serie = substr($chave_acesso, 22, 3); |
3336 | 3336 | $numero = substr($chave_acesso, 25, 9); |
@@ -3346,10 +3346,9 @@ discard block |
||
3346 | 3346 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
3347 | 3347 | foreach ($refNFP as $umaRefNFe) { |
3348 | 3348 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
3349 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3350 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
3351 | - ''; |
|
3352 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3349 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3350 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
3351 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3353 | 3352 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
3354 | 3353 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
3355 | 3354 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3375,6 +3374,6 @@ discard block |
||
3375 | 3374 | imagedestroy($image); |
3376 | 3375 | $stringdata = ob_get_contents(); // read from buffer |
3377 | 3376 | ob_end_clean(); |
3378 | - return 'data://text/plain;base64,'.base64_encode($stringdata); |
|
3377 | + return 'data://text/plain;base64,' . base64_encode($stringdata); |
|
3379 | 3378 | } |
3380 | 3379 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @param string $sDestino Destino do PDF I-browser D-download S-string F-salva |
73 | 73 | * @param array $aEnd array com o endereço do emitente |
74 | 74 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
75 | - * @param string $fonteDANFE Nome da fonte alternativa do DAnfe |
|
76 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
75 | + * @param string $fontePDF Nome da fonte alternativa do DAnfe |
|
76 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
77 | 77 | */ |
78 | 78 | public function __construct( |
79 | 79 | $docXML = '', |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | |
235 | 235 | /** |
236 | 236 | * Monta o cabeçalho |
237 | - * @param number $x |
|
238 | - * @param number $y |
|
239 | - * @param number $pag |
|
237 | + * @param integer $x |
|
238 | + * @param integer $y |
|
239 | + * @param integer $pag |
|
240 | 240 | * @return number |
241 | 241 | */ |
242 | 242 | private function pHeader($x, $y, $pag) |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | |
431 | 431 | /** |
432 | 432 | * Monta o corpo da pagina |
433 | - * @param number $x |
|
434 | - * @param number $y |
|
433 | + * @param integer $x |
|
434 | + * @param double $y |
|
435 | 435 | */ |
436 | 436 | private function pBody($x, $y) |
437 | 437 | { |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | /** |
484 | 484 | * Monta o rodapé |
485 | - * @param number $x |
|
485 | + * @param integer $x |
|
486 | 486 | * @param number $y |
487 | 487 | */ |
488 | 488 | protected function pFooter($x, $y) |
@@ -542,6 +542,9 @@ discard block |
||
542 | 542 | return $this->pdf->Output($nome, $destino); |
543 | 543 | } |
544 | 544 | |
545 | + /** |
|
546 | + * @param string $original |
|
547 | + */ |
|
545 | 548 | private function imagePNGtoJPG($original) |
546 | 549 | { |
547 | 550 | $image = imagecreatefrompng($original); |