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:

enter image description here

but in pdf version, this

enter image description here

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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -