2014-12-10 3 views
0

PHP를 생성하기 위해 PHP와 FPDF를 사용하고 있습니다. 내 문제는 데이터가 아랍어로 표시되지 않는다는 것입니다. PDF 내용에 아랍어 데이터를 표시하는 방법은 무엇입니까?FPDF에서 아랍어 데이터를 표시하는 방법?

require('include/fpdf/fpdf.php'); 
class PDF extends FPDF { 

// Page header 
function Header() 
{ 

    $this->Image('include/fpdf/tutorial/logo.png',10,6,30);// Logo 
    $this->SetFont('Arial','B',15);// Arial bold 15 
    $this->Cell(80);// Move to the right 
    $this->Cell(30,10,'العنوان',1,0,'C');// Title 
    $this->Ln(20);// Line break 
} 

// Page footer 
function Footer() 
{ 

    $this->SetY(-15);// Position at 1.5 cm from bottom 
    $this->SetFont('Arial','I',8);// Arial italic 8 
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');// Page number 
}} 


    // Instanciation of inherited class 
    $pdf = new PDF(); 

    $pdf->AliasNbPages(); 

    $pdf->AddPage(); 

    $pdf->SetFont('Times','',12); 

    for($i=1;$i<=40;$i++) 

    $pdf->Cell(0,10,' تجربة '.$i,0,1); 

    $pdf->Output(); 
+0

방법 : http://stackoverflow.com/questions/17162814/how-to-write-arabic-in-pdf-using-fpdf-php – Vainglory07

+0

http://stackoverflow.com/questions/2453728/arabic -script-in-pdf-created-by-ufpdf –

+0

UTF-8을 사용합니다.이 해결책은 http://stackoverflow.com/a/21530540/3065387입니다. – Tarsis

답변

0

FPDF에서 기본적으로 지원하지 않는 UTF-8 문자,하지만 ISO-8859-1 또는 Windows-1252 :

여기 내 코드입니다.

자신 만의 글꼴을 만들어야하지만 쉬운 일은 아닙니다. 도움이 필요하면 this answer을보십시오.

관련 문제