I have this block of code to use MPDF PHP library to convert a HTML document to PDF document, HTML document has both LTR and RTL languages:
$mpdf = new mPDF;
$content = '<div lang="he" style="direction: rtl;">רוחב: <span lang="en" style="direction: ltr; display: inline-block">483 mm (19")</span></div>';
$mpdf->autoLangToFont = true;
$mpdf->WriteHTML($content);
$mpdf->Output();
The HTML version of $content displays correctly:
But in the PDF version, I get this
I have tried to apply many CSS styles but couldn't find any way to solve this. Do you have any solution? Thanks!
P/S: I don't speak Hebrew or any RTL language.
rtl
for parent div only -$content = '<div lang="he" style="direction: rtl;">רוחב: <span lang="en">483 mm (19")</span></div>';
– Armen