 |
|
โค้ด pdf ปกติ
Code (PHP)
require('fpdf.php');
class PDF extends FPDF
{
function Header()
{
global $title;
$this->SetFont('arial','',15);
$w=$this->GetStringWidth($title)+6;
$this->Ln(10);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('arial','',8);
$this->SetTextColor(128);
$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
}
function ChapterTitle($num,$label)
{
$this->SetFont('arial','',12);
$this->SetFillColor(200,220,255);
$this->Cell(0,6,"Row $num : $label",0,1,'L',true);
$this->Ln(4);
}
function PrintChapter($num,$title,$file)
{
$this->AddPage();
$this->ChapterTitle($num,$title);
}
}
$pdf=new PDF();
$pdf->SetAuthor('xx');
$pdf->PrintChapter(1,'data 1'); //หน้า 1
$pdf->PrintChapter(2,'data 2'); //หน้า 2
$pdf->Output();
แต่ถ้ารับค่าจากฐานข้อมูลมันจะออกมาแค่ แถวแรกแถวเดียว
ไม่รู้จะให้มัน สร้างออกมาเองยังไง ช่วยทีนะคะ
|
 |
 |
 |
 |
Date :
2010-05-27 13:52:18 |
By :
amster |
|
 |
 |
 |
 |
|
|
 |