在所有页面中修复了tcpdf中的rtl方向

i have a problem with TCPDF library ,i'm generating pdf file usind TCPDF library in arabic language,the file direction is rtl so i used $pdf->setRTL(true); , and every thing is fine in the first page ,put in the second page or third the direction reseted to ltr!!!

this is apice of my code:

$pdf->AddPage();

$l = Array();
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = '';
$l['w_page'] = '';
$pdf->setLanguageArray($l);
$pdf->SetFont('almohanad', '', 16);
$pdf->setRTL(true); // cehck here if ar or en



$html = '
  <style>
    html{
      direction:rtl;
    }
  </style>

  <div style="direction:rtl">  
    <br/><br/>
    <img src="' . $image . '" />
    <br/>
    <span style="color:green">'.$date.'</span>
    <h5 style="color:gray">'.$title.'</h5>
    <div style="color:blue;direction:rtl">'.$content.'</div>
  </div>
';

$pdf->writeHTML($html, true, false, false, true, "");
$pdf->setRTL(true);
$pdf->lastPage();
#excute the file
$pdf->Output($fileName, 'I');

So my question is: how can I make all pages in tcpdf have the same direction as rtl ???

This problem was fixed by Iranians in the TCPDF Class.
Download TCPDF from http://www.tcpdf.org/
and run example_018.php in examples

//Before Write
// set some language dependent data:
$lg = Array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'rtl';
$lg['a_meta_language'] = 'fa';
$lg['w_page'] = 'page';

// set some language-dependent strings (optional)
$pdf->setLanguageArray($lg);

//After Write
$pdf->setRTL(true);