Name

draw_text -- Paint a text string to a page

Synopsis

int draw_text ( int left, int bottom, string text, int pageid [,array parameters] )

Description

This function paints a string of text on a page specified by pageid at the location specified by left and bottom. The optional array parameters can be used to override the default text settings when placing the text.

Possible values for "font" are:

Font names are case-sensitive.

Examples

This is a complete script for creating a single paged PDF file:

$pdf = new pdffile;
$page = $pdf->new_page("letter");
$pdf->draw_text(50, 50, "This is a single page", $page);
echo $pdf->generate();

Place text 1 inch from the lower left corner of the page at size 16 point.

$param["height"] = 16;
$pdf->draw_text(72, 72, "This is 16 point text", $page, $param);

Place red, Courier text:

$param["color"] = $pdf->get_color('red');
$param["font"] = "Courier";
$pdf->draw_text(144, 144, "This is red, Courier text", $page, $param);

See Also

History

Early versions of the library had a draw_stext() function, but this has been replaced by draw_text().

Bugs

None known