mPDF Manual – mPDF functions

# WriteText()

Description

WriteText — Writes a single line of text directly to the PDF document at a specified position.

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. &apos; &#8812; or &#x21a4; 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.