Reputation: 107
In put and out put data are getting different on pdf file generated through fpdf.
input: uçak is Turkish word
Output: uçak is Turkish word
What I am doing:
I am using following code:
<?php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddFont('ArialMT','','ArialMT.php');
$pdf->AddPage();
$pdf->SetFont('ArialMT','',35);
$pdf->Write(10,'uçak is Turkish word');
$pdf->Output();
?>
which results in the following output:
uçak is Turkish word
Where am I making mistake? Do I have to do any additional task?
Upvotes: 2
Views: 3672
Reputation: 17
This worked for Turkish language...
<?php
require('tfpdf.php');
$pdf = new tFPDF();
$pdf->AddPage();
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->Cell(130 ,5,'Uçak',0,0);
$pdf->SetFont('DejaVu','',12);
$pdf->Cell(130 ,5,'Fıstıkçı Şahap',0,0);
$pdf->Output("fatura.pdf","D");
?>
Upvotes: 0
Reputation: 386
I answered this in the comments section above, but for future reference:
By default, FPDF
does not support unicode characters. There are two popular extensions available, which are:
FPDF
with unicode support.Upvotes: 6