Compare commits
1 Commits
b0d2132e25
...
gha-test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfed40f535 |
30
.github/workflows/pint.yaml
vendored
Normal file
30
.github/workflows/pint.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Laravel Pint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Reinstall system libraries to ensure compatibility
|
||||||
|
- name: Ensure system libraries are up-to-date
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --reinstall --yes git libc6
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: "8.3"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-interaction --prefer-dist --no-progress
|
||||||
|
|
||||||
|
# Run pint in test mode, check only files different from master branch
|
||||||
|
- name: Run Laravel Pint in test mode
|
||||||
|
run: vendor/bin/pint --test --diff=master
|
||||||
@@ -24,15 +24,15 @@ class PalletController extends Controller
|
|||||||
$qrBinary = $output->output($qrCode, 100);
|
$qrBinary = $output->output($qrCode, 100);
|
||||||
$qrBase64 = base64_encode($qrBinary);
|
$qrBase64 = base64_encode($qrBinary);
|
||||||
|
|
||||||
return '
|
$html = '
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
body { margin: 0; padding: 0; width: 60mm; height: 14mm; font-size: 10pt; font-family: DejaVu Sans, sans-serif; }
|
body { margin: 0; padding: 0; width: 60mm; height: 14mm; font-size: 10pt; font-family: DejaVu Sans, sans-serif; }
|
||||||
.sticker-table { width: 60mm; height: 14mm; border-collapse: collapse; }
|
.sticker-table { width: 60mm; height: 14mm; border-collapse: collapse; }
|
||||||
.qr-cell { width: 14mm; text-align: right; vertical-align: bottom; padding-left: 4mm; padding-top: -6mm; }
|
.qr-cell { width: 14mm; text-align: left; vertical-align: middle; padding-left: 6mm; padding-top: 2mm; }
|
||||||
.text-cell { text-align: left; vertical-align: middle; font-size: 16pt; padding-left: 4mm; padding-top: 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
|
.text-cell { text-align: left; vertical-align: middle; font-size: 15pt; padding-left: 4mm; padding-top: 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
|
||||||
img.qr { width: 13mm; height: 13mm; display: block; }
|
img.qr { width: 18mm; height: 18mm; display: block; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -46,31 +46,23 @@ class PalletController extends Controller
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<script>
|
|
||||||
window.onload = function () {
|
|
||||||
window.print();
|
|
||||||
setTimeout(function () {
|
|
||||||
window.close();
|
|
||||||
}, 500); // Wait 0.5 seconds before closing
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
';
|
';
|
||||||
|
|
||||||
// $mpdf = new Mpdf([
|
$mpdf = new Mpdf([
|
||||||
// 'mode' => 'utf-8',
|
'mode' => 'utf-8',
|
||||||
// 'format' => [60, 14],
|
'format' => [60, 14],
|
||||||
// 'margin_left' => 0,
|
'margin_left' => 0,
|
||||||
// 'margin_right' => 0,
|
'margin_right' => 0,
|
||||||
// 'margin_top' => 0,
|
'margin_top' => 0,
|
||||||
// 'margin_bottom' => 0,
|
'margin_bottom' => 0,
|
||||||
// // 'tempDir' => '/var/www/storage/mpdf-tmp',
|
'tempDir' => '/var/www/storage/mpdf-tmp',
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
// $mpdf->WriteHTML($html);
|
$mpdf->WriteHTML($html);
|
||||||
// // Output PDF to browser for printing
|
$mpdf->Output('qr-label.pdf', 'I');
|
||||||
// $mpdf->Output('qr-label.pdf', 'I');
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user