Viewing file: tuto2.php (1.26 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require('../fpdf_thai.php');
class PDF extends FPDF_TH
{
//Page header
function Header()
{
//Logo
$this->Image('logo_pb.png',10,8,33);
//Arial bold 15
$this->SetFont('AngsanaNew','B',22);
//Move to the right
$this->Cell(80);
//Title
$this->Cell(30,10,'หัวข้อเรื่อง',1,0,'C');
//Line break
$this->Ln(20);
}
//Page footer
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('AngsanaNew','I',14);
//Page number
$this->Cell(0,10,'หน้าที่ '.$this->PageNo().'/{nb}',0,0,'C');
}
function SetThaiFont(){
//กำหนดฟอนต์ภาษาไทย
$this->AddFont('AngsanaNew','','angsa.php');
$this->AddFont('AngsanaNew','B','angsab.php');
$this->AddFont('AngsanaNew','I','angsai.php');
$this->AddFont('AngsanaNew','IB','angsaz.php');
$this->AddFont('AngsanaUPC','','AngsanaUPC.php');
}
}
//Instanciation of inherited class
set_time_limit(0) ;
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->SetThaiFont();
$pdf->AddPage();
$pdf->SetFont('AngsanaNew','',16);
for($i=1;$i<=2000;$i++)
$pdf->Cell(0,10,' แสดงบรรทัดที่ '.$i.
' แสดงบรรทัดที่ '.$i.
' แสดงบรรทัดที่ '.$i.
' แสดงบรรทัดที่ '.$i.
' แสดงบรรทัดที่ '.$i.
' แสดงบรรทัดที่ '.$i,0,1);
$pdf->Output();
?>
|