Name

draw_line -- Paint a series of lines to a page

Synopsis

int draw_line ( float xarray, float yarray, int page [,array parameters] )

Description

This function paints a series of lines to the page specified by page.

The parameters array provides control over the painting operation as describe in the parameters documentation.

The path of the line is specified by xarray and yarray, which are arrays of pairs of (x, y) coordinates.

Examples

Paints a single line segment with default parameters:

$x[0] = $y[0] = 5;
$x[1] = $y[1] = 30;
$pdf->draw_line($x, $y, $page);

Place a red, thick-lined triangle:

$x[0] = $x[2] = $y[1] = $y[0] = $x[3] = $y[3] = 5;
$x[1] = $y[2] = 30;
$param["width"] = 3; // PDF units
$param["strokecolor"] = $pdf->get_color('red');
$pdf->draw_rectangle($x, $y, $page, $param);

See Also

History

The draw_line function was added in version 1.13.

Bugs

None known