mPDF Manual – mPDF functions

SetDirectionality()

(mPDF >= 1.0)

SetDirectionality – Set the document RTL state

Description

void SetDirectionality ( string $dir )

Set the document RTL state. This defines the default alignment of tables, columns, text justification, page layout etc. See RTL & Bidirectional Text for more details. If SetDirectionality(‘rtl’) is set, Text Bidirectionality is automatically turned on.

Parameters

$dir

Defines the directionality of the document

BLANK or omitted (or any value other than RTL) sets the default of LTR

Values (case-insensitive)

LTR

RTL

DEFAULT: LTR

Examples

Example #1

<?php

$mpdf = new mPDF('utf-8');

$mpdf->SetDirectionality('rtl');

$mpdf->WriteHTML('
דג סקרן שט בים מאוכזב ולפתע מצא חברה
');

$mpdf->Output();

?>