Horde_Pdf_Writer::line PHP Method

line() public method

All coordinates can be negative to provide values from the right or bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2).
See also: setLineWidth()
See also: setDrawColor()
public line ( float $x1, float $y1, float $x2, float $y2 )
$x1 float Abscissa of first point.
$y1 float Ordinate of first point.
$x2 float Abscissa of second point.
$y2 float Ordinate of second point.
    public function line($x1, $y1, $x2, $y2)
    {
        if ($x1 < 0) {
            $x1 += $this->w;
        }
        if ($y1 < 0) {
            $y1 += $this->h;
        }
        if ($x2 < 0) {
            $x2 += $this->w;
        }
        if ($y2 < 0) {
            $y2 += $this->h;
        }
        $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S', $x1 * $this->_scale, ($this->h - $y1) * $this->_scale, $x2 * $this->_scale, ($this->h - $y2) * $this->_scale));
    }