|
 |
|
ต้องทำยังไงค่ะ TCPDF ไม่เป็นภาษาไทย ลองใส่ฟ้อนไทยแล้วขึ้นช่องสี่เหลียม ต้องทำยังไงต่อดี |
|
 |
|
|
 |
 |
|
สอบถามหน่อยค่ะ TCPDF ไม่เป็นภาษาไทย ลองเปลี่ยนเป็น thsarabun แล้วเป็นภาษาต่างด้าว แต่พอใส่ตรงๆ เป็นภาษาไทย แต่พอดึงจากฐานข้อมูลเป็นต่างด้าว ต้องตั้งค่ายังไงดีค่ะ
Code (PHP)
<?php
$user = 'sa';
$pass = 'xxxxxxxx';
$server = 'xxxxxxxx';
$database = 'xxxxx';
$connection_string = "DRIVER={SQL Server};SERVER=$server;DATABASE=$database;Client_CSet=UTF-8;";
$link = odbc_connect($connection_string,$user,$pass);
if ($link) {
// echo "Connection established.";
} else{
die("Connection could not be established.");
}
?>
<?php
// Include the main TCPDF library (search for installation path).
require_once('./lang/eng.php');
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, true);
$html =
$pdf=new TCPDF( 'P' , 'mm' , 'A4' );
$pdf->AddPage();
//$query = odbc_exec ($link,$sql);
//$row = odbc_fetch_array($query);
//echo $row['IO'];
$pdf->Image('form.png',5,10,230,305);
$y = 38;
$x = 26;
$id = $_GET['id'];
$sql = "select * From xxxx where ID = '$id' ";
$query = odbc_exec ($link,$sql);
while($row = odbc_fetch_array($query)){
$pdf->SetFont('freeserif','',12);
$pdf->Text( $x+153 , $y-13 ,$row['request_no']);
$pdf->SetFont('freeserif','',12);
$pdf->Text( $x , $y-2 ,date("d/m/Y",strtotime($row['create_date'])));
}
$pdf->Output();
Tag : PHP, Ms SQL Server 2014, PDF, Google Chrome, XAMPP, Windows

|
|
 |
 |
 |
 |
Date :
2018-12-19 14:52:33 |
By :
mewhappy |
View :
1634 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ในกระทู้เก่าๆ มีวิธีแนะนำและการแก้ปัญหาอยู่นะครับ 
|
 |
 |
 |
 |
Date :
2018-12-20 17:21:13 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|