I'm using html2pdf (itself using TCPDF) to convert a HTML table element into a PDF file. This table has dynamic content, meaning that its number of columns can vary (sometimes 3, sometimes 11 columns, etc...).
One column contains an number that can be really long (ex: BF8545498134587). My problem is that when there's a lot of columns, this number exceed the column width. I'd like to wrap it (like using wrap-word in HTML/CSS). But html2pdf doesn't support these CSS properties.
I found a solution (there : Html2pdf doesn't support word-break:break-all css ) that consists of inserting a zero width space (​
in HTML, \xE2\x80\x8B
in UTF-8 ) between each characters. It works perfectly fine in HTML, but in the PDF document, this zero width space is replaced by '?'.
I tried to change the font-family in the TCPDF class (having found this : http://www.fileformat.info/info/unicode/char/200b/fontsupport.htm to know which font to use with this HTML entity) but nothing's changed...
I saw other answers telling to use TCPDF functions like writeHTMLCell()
or using MultiCell()
rather than Cell()
but I can't apply these solutions for several reasons that I'm not allowed to tell here.
So I don't know where to look now.
Thanks in advance for any help.