Try the following piece of HTML with the WriteHTML function, result is that the text that has a space in front if it, is not rendered in the PDF, while the text that has no leading space, does appear.
I have experienced an issue like this, but it was not the fault of TCPDF. Some HTML gets written with a UTF-8 hard space character, which TCPDF rejects (whether that's right or wrong I don't know). TinyMCE definitely writes hard spaces into the HTML it generates when it encounters " "...
You can do something like this to convert UTF-8 hard spaces to soft spaces before sending the HTML to TCPDF:
$text = str_replace("\xC2\xA0", ' ', $text);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As indicated by Robert Johnson this seems to be a coding issue.
You must be sure that the HTML code is properly encoded and eventually you can use the fixHTMLCode() method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Edit; escaped the HTML
<table>
<tr>
<td>This text is visible</td>
<td> This text is not! (mind the leading space)</td>
</tr>
</table>
Last edit: Liam Vans 2014-09-04
I have experienced an issue like this, but it was not the fault of TCPDF. Some HTML gets written with a UTF-8 hard space character, which TCPDF rejects (whether that's right or wrong I don't know). TinyMCE definitely writes hard spaces into the HTML it generates when it encounters " "...
You can do something like this to convert UTF-8 hard spaces to soft spaces before sending the HTML to TCPDF:
As indicated by Robert Johnson this seems to be a coding issue.
You must be sure that the HTML code is properly encoded and eventually you can use the fixHTMLCode() method.