Reputation: 1845
here after including the file of fpdf, and printing the text with English it's working fine
but when i use the Persian(مثال یک) it's showing some kind of different text.
$html = 'این یک مثال هست';
$pdf=new HTML2PDF();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
$pdf->WriteHTML2("<br><br><br><br><br>$html");
$pdf->SetFont('Arial','B',3);
$pdf->Output();
Note: with english it results fine only problem with arabic or persian.
regards
Upvotes: 2
Views: 1207
Reputation: 355
FPDF is a outdated (dead ?) project that natively does not handle UTF-8, that explains why you get weird characters when you use arabic or persian.
The good new is you can use TCPDF (http://www.tcpdf.org) which handles perfectly UTF-8.
Thus, the migration from FPDF to TCPDF is quite easy since it uses the same methods (same methods names, same arguments) as FPDF.
AFAIK, arabic characters are perfectly supported by the Arial font.
Upvotes: 3