1
0
forked from poc/pds

Added 2 copies of pallet number print for scan pallet

This commit is contained in:
dhanabalan
2025-07-29 13:26:13 +05:30
parent 0bde54cf1a
commit ab769d2287

View File

@@ -24,39 +24,41 @@ class PalletController extends Controller
$qrBinary = $output->output($qrCode, 100); $qrBinary = $output->output($qrCode, 100);
$qrBase64 = base64_encode($qrBinary); $qrBase64 = base64_encode($qrBinary);
return ' $htmlBlock = '
<html> <table class="sticker-table">
<head> <tr>
<style> <td class="qr-cell">
body { margin: 0; padding: 0; width: 60mm; height: 14mm; font-size: 10pt; font-family: DejaVu Sans, sans-serif; } <img class="qr" src="data:image/png;base64,' . $qrBase64 . '" alt="QR" />
.sticker-table { width: 60mm; height: 14mm; border-collapse: collapse; } </td>
.qr-cell { width: 14mm; text-align: right; vertical-align: bottom; padding-left: 6mm; padding-top: 0mm; } <td class="text-cell">
.text-cell { text-align: left; vertical-align: middle; font-size: 16pt; padding-left: 1mm; padding-top: 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; } ' . htmlspecialchars($palletNo) . '
img.qr { width: 13mm; height: 13mm; display: block; } </td>
</style> </tr>
</head> </table>';
<body>
<table class="sticker-table"> return '
<tr> <html>
<td class="qr-cell"> <head>
<img class="qr" src="data:image/png;base64,' . $qrBase64 . '" alt="QR" /> <style>
</td> body { margin: 0; padding: 0; width: 60mm; height: auto; font-size: 10pt; font-family: DejaVu Sans, sans-serif; }
<td class="text-cell"> .sticker-table { width: 60mm; height: 14mm; border-collapse: collapse; page-break-after: always; }
' . htmlspecialchars($palletNo) . ' .qr-cell { width: 14mm; text-align: right; vertical-align: bottom; padding-left: 6mm; padding-top: 0mm; }
</td> .text-cell { text-align: left; vertical-align: middle; font-size: 16pt; padding-left: 1mm; padding-top: 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
</tr> img.qr { width: 13mm; height: 13mm; display: block; }
</table> </style>
<script> </head>
window.onload = function () { <body>
window.print(); ' . $htmlBlock . $htmlBlock . '
setTimeout(function () { <script>
window.close(); window.onload = function () {
}, 500); // Wait 0.5 seconds before closing window.print();
}; setTimeout(function () {
</script> window.close();
</body> }, 1000); // Wait 1 second before closing
</html> };
'; </script>
</body>
</html>';
// $mpdf = new Mpdf([ // $mpdf = new Mpdf([
// 'mode' => 'utf-8', // 'mode' => 'utf-8',