BUG 10958 La funcion PMF GenerateOutputDocuemnt no esta generando el output document SOLVED

- When a html string is in other encoding type doesn't generate the pdf using TCPDF
- Sanitize the html
This commit is contained in:
Julio Cesar Laura
2013-03-12 18:31:17 -04:00
parent a8a9a0dde1
commit 9b63600ab6
2 changed files with 13 additions and 1 deletions

View File

@@ -892,7 +892,12 @@ class OutputDocument extends BaseOutputDocument
// Print text using writeHTMLCell()
// $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
$pdf->writeHTML($sContent, false, false, false, false, '');
if (mb_detect_encoding($sContent) == 'UTF-8') {
$sContent = utf8_decode($sContent);
}
$doc = new DOMDocument('1.0', 'UTF-8');
$doc->loadHtml($sContent);
$pdf->writeHTML($doc->saveXML(), false, false, false, false, '');
// ---------------------------------------------------------
// Close and output PDF document