|
|
|
ขอรบกวนหนน่อยครับคือผมจะดึงรูปมาใส่ใน pdf แต่ขึ้นแบบนี้ Unsupported image type ต้องแก้ยังครับ |
|
|
|
|
|
|
|
Code (PHP)
require('fpdf.php');
include('../connect.php');
$strSQL = "SELECT * FROM coms WHERE id='".$_GET['id']."'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
//echo $strSQL;
$objResultcom = mysql_fetch_array($objQuery);
$img=$objResultcom['pic'];
///mysql_close($objConnect);
$strSQLmo="SELECT * FROM monitor WHERE mo_id='".$objResultcom['mo_id']."' ";
$objQuerymo = mysql_query($strSQLmo) or die ("Error Query [".$strSQLmo."]");
$objResult = mysql_fetch_array($objQuerymo);
define('FPDF_FONTPATH','font/');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->AddFont('angsa','','angsa.php');
$pdf->SetFont('angsa','',20);
$img="<img src='../picofcomputer/'".$objResultcom['pic']."' width='200' height='200' title=''/>";
$pdf->Cell(50,10,iconv( 'UTF-8','TIS-620','หมายเลขทรัพย์สิน '.$objResultcom['com_id']),0,1,"c");
$pdf->cell(190,50,$pdf->Image($img,$pdf->GetX(),$pdf->GetY(),150,50,'',$img),1,1,'C');
$pdf->Cell(50,10,iconv( 'UTF-8','TIS-620',$img),0,1,"c");
$pdf->SetFont('angsa','',20);
$pdf->Cell(50,10,iconv( 'UTF-8','TIS-620','หมายเลขทรัพย์สิน '.$objResultcom['com_id']),0,1,"c");
$pdf->SetFont('angsa','',14);
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ฮาร์ดแวร์ '),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ชื่อคอมพิวเตอร์ '.$objResultcom['com_name']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','เมนบอร์ด '.$objResultcom['mainboard']),22,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','แรม '.$objResultcom['ram']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ซีพียู '.$objResultcom['cpu']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ฮาร์ดดิสก์ '.$objResultcom['harddisk']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','การ์ดจอ '.$objResultcom['vgacard']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ประเภท '.$objResultcom['type1']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ราคา '.$objResultcom['price']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','สภาพ '.$objResultcom['position']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','วันที่เริ่มใช้ '.$objResultcom['startdate']),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620','ประเภท '.$objResultcom['type1']),0,1,"L");
$pdf->SetFont('angsa','',20);
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620'," ซอฟต์แวร์ " ),0,1,"L");
$pdf->SetFont('angsa','',14);
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"ระบบปฏิบัติการ"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"สิทธิการใช้"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"LICENSE"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"อ๊อฟฟิศ"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"LICENSE"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"แอนตี้ไวรัส"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"ตัวแทนจำหน่าย"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"SoftPro"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"Mydream"),0,1,"L");
$pdf->Cell(0,7,iconv( 'UTF-8','TIS-620',"โปรแกรมอื่นๆ"),0,1,"L");
$pdf->Output("MyPDF/MyPDF.pdf","F");
|
|
|
|
|
Date :
2014-10-03 11:51:16 |
By :
raksaksaethao |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$pdf->Image("../picofcomputer/{$objResultcom['pic']}",155,57,35,40,'');
|
|
|
|
|
Date :
2014-10-03 12:02:59 |
By :
sabaitip |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2014-10-03 13:07:00 |
By :
raksaksaethao |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แนะนำให้ใช้ mpdf ครับ มันใช่ html ได้
Code (PHP)
$txt ='
test
<img......>
<table>...........</table>
';
$mpdf->WriteHTML($txt);
|
|
|
|
|
Date :
2014-10-03 13:24:20 |
By :
gaowteen |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|