I'm using html2pdf and passing $this->renderpartial('view',array(..),true) to the $content.
Here's the code:
$content = $this->renderpartial('view',array(..),true);
$html2pdf = new HTML2PDF('P','A4','en');
$html2pdf->pdf->SetDisplayMode('real');
$html2pdf->WriteHTML($content);
$html2pdf->Output('/var/www/myapp/images/example.pdf','F');
The view declares an otf font.. which I have succesfully imported into tcpdf using an online-converter.
But the output of the pdf has some arabic, but some of the letters and weirdly english letters into squares. What's worse is that even though in my html there's the directive of RTL .. some parts of the document are still in LTR.
I have the output html with me if you need to see it.. without the html2pdf bit.. straight out from the $this->renderpartial. If you need it I'll paste it or attach as an image.
Ok, so there is no problem. It's just that the font I used didn't get converted to the desired tcpdf format fully. Some characters are missing, including the english character-set.
I tried with another arabic included font and things worked fine.
This is important: html2pdf does support utf-8 out of the box when used with the tcpdf library.