php - MPDF: Failed to display a mix of LTR and RTL text -
i have block of code use mpdf php library convert html document pdf document, html document has both ltr , 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 pdf version, this
i have tried apply many css styles couldn't find way solve this. have solution? thanks!
p/s: don't speak hebrew or rtl language.
your code working fine in mpdf 5.7.4.
for mpdf 6.0 need use <bdo>
element instead of css property direction
:
$content = '<div dir="rtl">רוחב: <bdo dir="ltr">483 mm (19")</bdo></div>';
for more information mpdf 6.0 see this reference.
Comments
Post a Comment