|
|
ต้องการจะพิมพ์บาร์โค็ด โดยดึงเลขมาจากฐานข้อมูลอ่ะค่ะ แต่มันขึ้น ERROR " FPDF error: Could not include font definition file " แบบนี้อ่ค่ะ ไม่รู้จะแก้ไขยังไงแล้ว ค่ะ วอนท่านผู้รู้ช่วยแนะนำหน่อยนะค่ะ
Code (PHP)
<?php
require("fpdf.php");
$ser = 'localhost';
$username = 'root';
$pass = 'root';
$dbname = 'db';
$connect = mysql_connect($ser,$username,$pass);
if (!$connect)
{
die('ติดต่อฐานข้อมูลไม่ได้ เนื่องจาก : ' . mysql_error());
}
$db=mysql_select_db($dbname, $connect);
$sql = "select no_id from tbl_book where no_id ;
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$IDCARD = $row['no_id'];
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//ทำการสืบทอดคลาส FPDF ให้เป็นคลาสใหม่
class PDF extends FPDF
{
//Override คำสั่ง (เมธอด) Header
function Header() {
//นับจากขอบกระดาษด้านล่างขึ้นมา 5 มม.
$this->SetY( 5 );
//กำหนดใช้ตัวอักษร AngsanaNew ตัวเอียง ขนาด 12
$this->SetFont('AngsanaNew','',12);
}
}
$pdf = new PDF('L' , 'mm' , 'A4');
$pdf->AddFont('AngsanaNew','','angsa.php');
$pdf->AddFont('AngsanaNew','B','angsab.php');
$pdf->AddFont('AngsanaNew','I','angsai.php');
$pdf->AddFont('AngsanaNew','IB','angsaz.php');
$pdf->AddFont('Barcode','B','barcode.php');
$pdf->AddFont('Barcode2','','barcode2D.php');
$pdf->AddFont("canNongAor","","nongaor.php");
$pdf->AddFont('CordiaNew','','cordia.php');
$pdf->AddFont('CordiaNew','B','cordiab.php');
$pdf->AddFont('CordiaNew','I','cordiai.php');
$pdf->AddFont('CordiaNew','IB','cordiaz.php');
$pdf->AddFont('Tahoma','','tahoma.php');
$pdf->AddFont('Tahoma','B','tahomab.php');
$pdf->AddFont('BrowalliaNew','','browa.php');
$pdf->AddFont('BrowalliaNew','B','browab.php');
$pdf->AddFont('BrowalliaNew','I','browai.php');
$pdf->AddFont('BrowalliaNew','IB','browaz.php');
$pdf->AddFont('KoHmu','','kohmu.php');
$pdf->AddFont('KoHmu2','','kohmu2.php');
$pdf->AddFont('KoHmu3','','kohmu3.php');
$pdf->AddFont('MicrosoftSansSerif','','micross.php');
$pdf->AddFont('PLE_Cara','','plecara.php');
$pdf->AddFont('PLE_Care','','plecare.php');
$pdf->AddFont('PLE_Care','B','plecareb.php');
$pdf->AddFont('PLE_Joy','','plejoy.php');
$pdf->AddFont('PLE_Tom','','pletom.php');
$pdf->AddFont('PLE_Tom','B','pletomb.php');
$pdf->AddFont('PLE_TomOutline','','pletomo.php');
$pdf->AddFont('PLE_TomWide','','pletomw.php');
$pdf->AddFont('DilleniaUPC','','dill.php');
$pdf->AddFont('DilleniaUPC','B','dillb.php');
$pdf->AddFont('DilleniaUPC','I','dilli.php');
$pdf->AddFont('DilleniaUPC','IB','dillz.php');
$pdf->AddFont('EucrosiaUPC','','eucro.php');
$pdf->AddFont('EucrosiaUPC','B','eucrob.php');
$pdf->AddFont('EucrosiaUPC','I','eucroi.php');
$pdf->AddFont('EucrosiaUPC','IB','eucroz.php');
$pdf->AddFont('FreesiaUPC','','free.php');
$pdf->AddFont('FreesiaUPC','B','freeb.php');
$pdf->AddFont('FreesiaUPC','I','freei.php');
$pdf->AddFont('FreesiaUPC','IB','freez.php');
$pdf->AddFont('IrisUPC','','iris.php');
$pdf->AddFont('IrisUPC','B','irisb.php');
$pdf->AddFont('IrisUPC','I','irisi.php');
$pdf->AddFont('IrisUPC','IB','irisz.php');
$pdf->AddFont('JasmineUPC','','jasm.php');
$pdf->AddFont('JasmineUPC','B','jasmb.php');
$pdf->AddFont('JasmineUPC','I','jasmi.php');
$pdf->AddFont('JasmineUPC','IB','jasmz.php');
$pdf->AddFont('KodchiangUPC','','kodc.php');
$pdf->AddFont('KodchiangUPC','B','kodc.php');
$pdf->AddFont('KodchiangUPC','I','kodci.php');
$pdf->AddFont('KodchiangUPC','IB','kodcz.php');
$pdf->AddFont('LilyUPC','','lily.php');
$pdf->AddFont('LilyUPC','B','lilyb.php');
$pdf->AddFont('LilyUPC','I','lilyi.php');
$pdf->AddFont('LilyUPC','IB','lilyz.php');
$pdf->SetMargins(25,10,18,5);
$pdf->AliasNbPages( 'tp' );
$pdf->AddPage();
$pdf->SetY(+10);
$pdf->SetFont('Barcode','B',16);
$pdf->Cell(40,5,iconv('UTF-8', 'TIS-620', '*'.$IDCARD.'*'), 0, 1, 'C');
$pdf->Ln(1);
$pdf->SetFont('CordiaNew','B',14);
$pdf->Cell(40,5,iconv('UTF-8', 'TIS-620', $IDCARD), 0, 1, 'C');
$pdf->Ln(10);
$pdf->Output();
?>
Tag : PHP
|
ประวัติการแก้ไข 2011-09-01 01:43:04
|
|
|
|
|
Date :
2011-09-01 01:42:04 |
By :
modzaa07 |
View :
1656 |
Reply :
2 |
|
|
|
|
|
|
|
|
|