|
|
ติดปัญหากับ Function Footer FPDF และตารางข้อมูลที่ทับซ้อนกัน
ตรงเส้นสีแดง คือ Footer นะครับ ผมลองปรับดูแล้วไม่ได้เลย ช่วยหน่อยนะครับ
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
require('fpdf.php');
define('FPDF_FONTPATH','font/');
class PDF extends FPDF
{
//Page header
function Header()
{
$this->AddFont('angsa','','angsa.php');
$this->AddFont('angsana','','angsa.php');
$this->AddFont('angsana','B','angsab.php');
$this->AddFont('angsana','I','angsai.php');
$this->AddFont('angsana','BI','angsaz.php');
$this->SetFont('angsa','',11);
$this->Text(3,7,iconv("UTF-8","TIS-620","0001)"),1,0);
$this->Text(260,7,iconv("UTF-8","TIS-620","0002"),1,0);
$this->SetFont('angsa','',12);
$this->Text(270,20,iconv("UTF-8","TIS-620","0003"),1,0);
$this->SetFont('angsana','B',17);
$this->Text(95,20,iconv("UTF-8","TIS-620","0004"),1,0);
$this->SetFont('angsana','',15);
$this->Text(5,33,iconv("UTF-8","TIS-620","0005"),1,0);
$this->Text(100,33,iconv("UTF-8","TIS-620","00006"),1,0);
$this->SetFont('angsana','',15);
$this->Text(5,41,iconv("UTF-8","TIS-620","0006"),1,0);
$this->Image('channel_13.jpg',49,37,80);
$this->Text(51,41,iconv("UTF-8","TIS-620",1234567891123),1,0);
$this->Image('channel_1.jpg',141,37,7);
$this->Text(150,41,iconv("UTF-8","TIS-620","0007"),1,0);
$this->Image('channel_4.jpg',176,37,25);
$this->Text(178,41,iconv("UTF-8","TIS-620",1234),1,0);
$this->Image('channel_1.jpg',141,45,7);
$this->Text(150,49,iconv("UTF-8","TIS-620","0008"),1,0);
$this->Text(150,57,iconv("UTF-8","TIS-620","0009"),1,0);
$this->Image('channel_4.jpg',176,53,25);
$this->Text(178,57,iconv("UTF-8","TIS-620",654321),1,0);
$this->SetFont('angsana','',13);
$this->Text(5,66,iconv("UTF-8","TIS-620","0010"),1,0);
$this->Text(81,66,iconv("UTF-8","TIS-620","............................................................................................."),1,0);
$this->SetFont('angsana','',15);
$this->Text(5,73,iconv("UTF-8","TIS-620","(0011"),1,0);
$this->AddFont('angsa','','angsa.php');
$this->AddFont('angsana','','angsa.php');
$this->AddFont('angsana','B','angsab.php');
$this->AddFont('angsana','I','angsai.php');
$this->AddFont('angsana','BI','angsaz.php');
$this->SetFont('angsana','',14);
$this->SetXY(10,78);
$this->Cell(14,14,iconv("UTF-8","TIS-620"," "),1,0,'C');
$this->Text(12,84,iconv("UTF-8","TIS-620","A"),1,0);
$this->Text(11,89,iconv("UTF-8","TIS-620","()"),1,0);
$this->Cell(34,14,iconv("UTF-8","TIS-620","B"),1,0,'C');
$this->Cell(17,14,iconv("UTF-8","TIS-620","C"),1,0,'C');
$this->Cell(55,14,iconv("UTF-8","TIS-620","D"),1,0,'C');
$this->Cell(25,14,iconv("UTF-8","TIS-620"," "),1,0,'C');
$this->Text(132,84,iconv("UTF-8","TIS-620","E"),1,0);
$this->Text(130,89,iconv("UTF-8","TIS-620","()"),1,0);
$this->Cell(20,14,iconv("UTF-8","TIS-620"," "),1,0,'C');
$this->Text(156,84,iconv("UTF-8","TIS-620","F"),1,0);
$this->Text(157,89,iconv("UTF-8","TIS-620",""),1,0);
$this->Cell(17,14,iconv("UTF-8","TIS-620","G"),1,0,'C');
$this->Cell(53,7,iconv("UTF-8","TIS-620","H"),1,0,'C');
$this->Cell(25,7,iconv("UTF-8","TIS-620","I"),1,0,'C');
$this->Cell(20,14,iconv("UTF-8","TIS-620","J"),1,0,'C');
$this->Ln();
$this->SetXY(192,85);
$this->Cell(30,7,iconv("UTF-8","TIS-620","H1"),1,0,'C');
$this->Cell(23,7,iconv("UTF-8","TIS-620","H2"),1,0,'C');
$this->Cell(25,7,iconv("UTF-8","TIS-620","I1 ()"),1,0,'C');
$this->Ln();
}
//Page footer
function Footer()
{
$this->AddFont('angsa','','angsa.php');
$this->AddFont('angsana','','angsa.php');
$this->AddFont('angsana','B','angsab.php');
$this->AddFont('angsana','I','angsai.php');
$this->AddFont('angsana','BI','angsaz.php');
$this->SetFont('angsana','',13);
$this->Text(24,169,iconv("UTF-8","TIS-620","000000000000000000041"),1,0);
$this->SetFont('angsana','',15);
$this->Text(157,178,iconv("UTF-8","TIS-620","ลงชื่อ ..........................................................................................."),1,0);
$this->SetFont('angsana','',15);
$this->Text(162,184,iconv("UTF-8","TIS-620","(.......................... นาย วานิชธนาคร ภัทรสิริ..........................)"),1,0);
$this->SetFont('angsana','',15);
$this->Text(5,197,iconv("UTF-8","TIS-620","000000000000000000042"),1,0);
$this->Text(23,197,iconv("UTF-8","TIS-620","1) 0043"),1,0);
$this->Text(23,202,iconv("UTF-8","TIS-620","2) 0044"),1,0);
$this->SetFont('angsa','',12);
//$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
$this->Text(270,25,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//Instanciation of inherited class
$pdf=new PDF('L' , 'mm' , 'A4' );
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->AddFont('angsa','','angsa.php');
$pdf->AddFont('angsana','','angsa.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวธรรมดา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','B','angsab.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','I','angsai.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
$pdf->AddFont('angsana','BI','angsaz.php');// เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana
for($i=1;$i<=31;$i++)
{
$pdf->Cell(14,7,$i,1,0,'C');
$pdf->Cell(34,7,iconv("UTF-8","TIS-620","A0081550803388"),1,0,'L');
$pdf->Cell(17,7,iconv("UTF-8","TIS-620","30/09/2555"),1,0,'C');
$pdf->Cell(55,7,iconv("UTF-8","TIS-620","รายการ"),1,0,'L');
$pdf->Cell(25,7,iconv("UTF-8","TIS-620","2,181,535.06"),1,0,'R');
$pdf->Cell(20,7,iconv("UTF-8","TIS-620","13,000.00"),1,0,'R');
$pdf->Cell(17,7,iconv("UTF-8","TIS-620","----"),1,0,'C');
$pdf->Cell(30,7,iconv("UTF-8","TIS-620","23091010090PFN"),1,0,'L');
$pdf->Cell(23,7,iconv("UTF-8","TIS-620","1.61"),1,0,'C');
$pdf->Cell(25,7,iconv("UTF-8","TIS-620","11,415.57"),1,0,'R');
$pdf->Cell(20,7,iconv("UTF-8","TIS-620","1270000865"),1,0,'C');
$pdf->Ln();
}
$pdf->Output("MyPDF/MyPDF.pdf","F");
?>
PDF Click <a href="MyPDF/MyPDF.pdf">here</a> to Download
</body>
</html>
Tag : PHP, CakePHP, Crystal Report, Reporting Service, Report Others
|
ประวัติการแก้ไข 2013-03-18 09:09:58
|
|
|
|
|
Date :
2013-03-18 09:09:12 |
By :
nattkhanesha |
View :
2097 |
Reply :
2 |
|
|
|
|
|
|
|
|
|