refactor(pdf): switch AWB template to landscape orientation

Update the AWB document generation to use landscape mode and adjust
the layout to utilize the additional horizontal space.

Key changes:
- Change `PdfService` orientation from portrait to landscape for AWB.
- Refactor `awb.blade.php` to use a side-by-side layout for terms
  and signatures.
- Adjust grid column widths from 50% to 25% to accommodate the
  new orientation.
- Update `@page` margin definitions for better print alignment.
This commit is contained in:
Kazem Alghasi 2026-10-03 20:33:15 +03:30
parent d4b9e5bff5
commit 93bcfb9ce7
5 changed files with 31 additions and 21 deletions

View File

@ -33,7 +33,7 @@ class PdfService
$html = view('pdfs.awb', $data)->render();
return $this->generatePdf($html, 'A4', 'portrait');
return $this->generatePdf($html, 'A4', 'landscape');
}
/**

View File

@ -13,11 +13,14 @@
}
/* ⚠️ Dompdf از box-sizing: border-box پشتیبانی نمی‌کند —
width باید 100% ناحیه قابل چاپ باشد و حاشیه‌ها با @page داده شوند؛
width: 210mm + padding یعنی 230mm واقعی و بیرون‌زدگی از سمت راست. */
@page { margin: 8mm 10mm; }
.page {
width: 100%;
}
width: 210mm + padding یعنی 230mm واقعی و بیرون‌زدگی از سمت راست.
موقتی یه تغییری برای تست میدهیم. */
@page {
margin-top: 10mm;
margin-bottom: 10mm;
margin-left: 15mm;
margin-right: 15mm;
}
/* ════════ Brand Colors ════════ */
/* Navy: #1a1a2e | Orange accent: #f59e0b | Gray bg: #f3f4f6 */
@ -108,9 +111,10 @@
margin-bottom: 6px;
}
.grid-table > tbody > tr > td {
width: 50%;
width: 25%; /* ✅ ۴ ستونه در عرضی */
vertical-align: top;
border: 1.5px solid #1a1a2e;
border-right: 0.5px solid #1a1a2e;
padding: 0;
}
.grid-table > tbody > tr > td.left {
@ -439,22 +443,28 @@
</div>
@endif
<!-- ════════ NOTES ════════ -->
<div class="notes">
<div class="notes-title">⚠ Terms &amp; Conditions</div>
Door-to-door service applies only to general cargo without special approvals. Consignee is responsible for import rules at destination. All shipments are subject to customs approval at origin and destination. The courier company cannot guarantee clearance.
</div>
<!-- ════════ SIGNATURE ════════ -->
<table class="signature-table">
<!-- ════════ NOTES + SIGNATURE (side by side in landscape) ════════ -->
<table style="width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 6px;">
<tr>
<td style="border-left: 1px solid #e5e7eb;">
Shipper Name &amp; Signature
<div class="sig-line"></div>
<td style="width: 60%; vertical-align: top; padding-right: 6px;">
<div class="notes" style="height: 45mm;">
<div class="notes-title">⚠ Terms &amp; Conditions</div>
Door-to-door service applies only to general cargo without special approvals. Consignee is responsible for import rules at destination. All shipments are subject to customs approval at origin and destination.
</div>
</td>
<td>
Date
<div class="sig-line">...../...../..........</div>
<td style="width: 40%; vertical-align: top;">
<table class="signature-table" style="height: 45mm;">
<tr>
<td style="border-left: 1px solid #e5e7eb;">
Shipper Signature
<div class="sig-line"></div>
</td>
<td>
Date
<div class="sig-line">...../...../..........</div>
</td>
</tr>
</table>
</td>
</tr>
</table>

Binary file not shown.

Binary file not shown.

Binary file not shown.