1
我有一個像ąčęėįšųūž
這樣的立陶宛字母問題。爲此,我使用tfpdf
和字體DejaVu
。當我從txt
文件獲得內容時,一切都很好,但我只是簡單地給出內容,然後我得到「????」。標題字符集設置爲utf-8
。TFPDF立陶宛信件
ob_start();
require('../fpd/tfpdf.php');
$pdf = new tFPDF();
$pdf->AddPage();
// Add a Unicode font (uses UTF-8)
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',10);
// Load a UTF-8 string from a file and print it
$txt = file_get_contents('../fpd/HelloWorld.txt');
$pdf->Write(8,$txt);
$pdf->Ln(10);
$txt1 = "ąčęėįšųž";
$pdf->Write(8,$txt1);
$pdf->Output('filename1.pdf', 'I');
ob_end_flush();
我也試過utf8_decode()但沒有區別 – Xinel
你試過Arial字體嗎? –
你有什麼問題?你如何使用?任何代碼?例子? –