 |
|

เป็นดังรูปนี้เลยครับ
ไปโหลด tcpdf barcode มาใช้ แล้วเรียกสร้างบาร์โค้ดแบบ PNG กับ SVG ขึ้นฟ้องดังภาพ
แต่ถ้า สร้างแบบ HTML ไม่เป็นอะไร แต่ติดตรงที่ว่า เวลามองในมุมมอง print มันไม่แสดงบาร์โค้ด
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>
<style>
body {
background: rgb(204,204,204);
}
page[size="A4"] {
background: white;
width: 21cm;
height: 29.7cm;
display: block;
margin: 0 auto;
margin-bottom: 0.5cm;
margin-top: 0.5cm;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding:1em;
}
@media print {
body, page[size="A4"] {
margin: 0;
box-shadow: 0;
page-break-after: always;
}
</style>
</head>
<body>
<?
include("barcode/tcpdf/tcpdf_barcodes_1d.php");
$barcodeobj = new TCPDFBarcode('09180', 'C128');
?>
<page size="A4">
<div><img src="../template/card12.png" width="339" height="212"/><img src="../template/nopic.png" width="75"/><img src="barcode/php-barcode-master/barcode.php?text=09180&codetype=Code128&size=20" /></div>
<div><? echo $barcodeobj->getBarcodeHTML(1, 20, 'black');?></div>
<div>------------------------------------------------------------------------------</div>
<div><? echo $barcodeobj->getBarcodeSVG(1, 20, 'black');?></div>
<div>------------------------------------------------------------------------------</div>
<div><? echo $barcodeobj->getBarcodePNG(1, 20, array(0,0,0));?></div>
</page>
</body>
</html>
Tag : PHP, MySQL, JavaScript, Ajax, jQuery
|
|
 |
 |
 |
 |
Date :
2016-05-13 04:54:15 |
By :
akkaneetha |
View :
1422 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |