0
我有TCPDF在PDF頁面上顯示我的UTF-8數據的問題。這裏是我的代碼的一部分:TCPDF顯示?而不是Č
TCPDF工作正常,但是當創建Pdf我得到了嗎?a?anska instedČačanska。
我嘗試使用「SET NAMES'utf8'」,但沒有結果。如果我刪除utf8_encode,則會獲得空白頁。
我嘗試使用這個答案,但沒有幫助: Why cant I use č,ć,đ charters in TCPDF table?
和我的老問題: TCPDF don't show č,ć,ž,š,đ from mysql only blank page
Font:
$pdf->SetFont('freeserif', '', 14, '', true);
Create Pdf:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
Part od code :
$id =$_POST['ajde']; // get data from jqgrid
$result = mysqli_query($con,"SELECT * FROM kuca where id=$id ");
while($row = mysqli_fetch_array($result))
{
$u= $row['adresa'];
$html = '
<table width="540" height="339" border="1" align="center" cellpadding="2" class="table table-hover" >
<tr>
<td><div align="left">Adresa:</div></td>
<td style="font-family:freesans" ">' . $u. '</td>
</tr>
</table>
$pdf->writeHTML(utf8_encode($html), true, 0, true, 0);
TNX,
帕夫萊