WriteText()
Description
WriteText — Writes a single line of text directly to the PDF document at a specified position.
Description
void WriteText( float $w, float $h, string $text)
Writes a single line of text directly to the PDF document at a specified position.
Prints a character string. The origin is on the left of the first character, on the baseline.
This method allows to place a string precisely on the page, but it is usually easier to use WriteCell()
,
MultiCell()
or Write()
which are the standard methods to print text.
Parameters
$w
-
Abscissa of the origin, horizontal.
$h
-
Ordinate of the origin, vertical.
$text
-
String to print. This method accepts UTF-8 encoded text, and will reverse RTL (right-to-left) text when appropriate.
Text containing HTML entities, as well as decimal and hex e.g.
'
≬
or↤
can be used, by setting:<?php $mpdf->text_input_as_HTML = true; //(default = false)
This will convert all the above to their appropriate characters, otherwise the text will be output as it is.
Note The methods Cell()
and Text()
from FPDF are still present, but should not be used directly as
they will not cope with UTF-8 encoded text. Use the WriteCell()
and WriteText()
methods instead.
See the details for the original Text()
at FPDF equivalent.