NFePHP\Extras\PdfNFePHP::DashedHLine PHP Method

DashedHLine() public method

DashedLine Desenha uma linha horizontal tracejada com o FPDF
public DashedHLine ( number $x, number $y, number $w, number $h, number $n ) : none
$x number Posição horizontal inicial, em mm
$y number Posição vertical inicial, em mm
$w number Comprimento da linha, em mm
$h number Espessura da linha, em mm
$n number Numero de traços na seção da linha com o comprimento $w
return none
    public function DashedHLine($x, $y, $w, $h, $n)
    {
        $this->SetDrawColor(110);
        $this->SetLineWidth($h);
        $wDash = $w / $n / 2;
        // comprimento dos traços
        for ($i = $x; $i <= $x + $w; $i += $wDash + $wDash) {
            for ($j = $i; $j <= $i + $wDash; $j++) {
                if ($j <= $x + $w - 1) {
                    $this->Line($j, $y, $j + 1, $y);
                }
            }
        }
        $this->SetDrawColor(0);
    }