Open julienfelixweb opened 3 years ago
I am also facing same problem.
you need to split your HTML (setRTL(false) before images)
for example image is in the middle:
$pdf->setRTL(true);
$html = 'some rtl text......';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->setRTL(false);
$html = '<img ....>';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->setRTL(true);
$html = 'some rtl text.....';
$pdf->writeHTML($html, true, false, true, false, '');
Thanks @alibarrak for this work around, unfortunately it won't fix it in my case. But it demonstrates that the img tag is not well handle in RTL. I'm sure it's an easy fix but I can't figure out where it is. It seams that in RTL images are systematically push to the right and the amount of this translation is equal to the width.
I did found a fix which I'm still testing. see #165
I have found the same issue after the change from https://github.com/tecnickcom/TCPDF/issues/165, in my use case, I am calling TCPDF->Image() function directly to print an image as background of the whole page (I am not using the writeHTML function and the width of the image is the same as the width of the page) I was able to fix it with this code: https://github.com/tecnickcom/TCPDF/commit/b543e4df6289be5918e0054b9cc2605d5e5f0889#commitcomment-54402407
This is just a quickfix, which could solve https://github.com/tecnickcom/TCPDF/issues/303 but maybe creates more problems with https://github.com/tecnickcom/TCPDF/issues/165
Maybe someone else can give it a try, if both issues are working we could submit a MR.
Seems to be fixed with #510
Hi I'm meeting this issue, is there a simple fix to solve this ?
Thanks