There are two problems with the TCPDF package (version 1.53.0.TC023_PHP4)--NOT with the module itself, but obviously affecting it. To see the effect, open the "test_unicode.php" file and insert this line at line 68, just after AddPage():
$pdf->WriteHTML('<br><br><br>DEBUG: this is <em>italic</em> text and this is <strong>bold</strong> text and this is <em>italic</em> text<br><br><br>', true, 0);
Upload and then observe the effect:
- Extra space is inserted after the closing tag of bold and italic text.
- The second bit of italic text is NOT rendered as italics. The formatting is broken from then on out.
I posted a patch at the TCPDF Sourceforge page to fix the problem; find it here if you wish.
I'll also paste my solution here.
Once you have downloaded and installed the tcpdf package under the pdfview module directory, open up the "tcpdf.php" file.
-------------- FIX NUMBER ONE:
In file "tcpdf.php" change line 2264 from:
$this->Cell($this->GetStringWidth(substr($s, $j)." "),
$h, substr($s, $j), 0, 0, '', $fill, $link);to:
$this->Cell($this->GetStringWidth(substr($s, $j)), $h,
substr($s, $j), 0, 0, '', $fill, $link);-------------- FIX NUMBER TWO:
In file "tcpdf.php" find the six lines starting with
line 3969:
case 'strong': {
$this->setStyle('b', true);
}
case 'em': {
$this->setStyle('i', true);
}change to:
case 'strong': {
$this->setStyle('b', true);
break;
}
case 'em': {
$this->setStyle('i', true);
break;
}That should fix it!
Comments
Comment #1
Egon Bianchet commentedI'm leaving this open as a support request ... just in case someone else needs it