mPDF Manual – mPDF functions


(mPDF ≥ 1.0)

SetDirectionality – Set the document RTL state


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.



Defines the directionality of the document

BLANK or omitted (or any value other than 'rtl' or 'RTL') sets the default of 'ltr'

Values (case-insensitive)

  • 'ltr'
  • 'rtl'

Default: 'ltr'


$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8']);


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

Fork me on GitHub