From 0b6d810ca63cb91bfd4c27888f8c4696f1df5cb0 Mon Sep 17 00:00:00 2001 From: James M <31522486+azmcnutt@users.noreply.github.com> Date: Thu, 6 Mar 2025 11:12:16 -0700 Subject: [PATCH] FEAT: Add Label 5520 with 1D barcode - remove 2D barcode FEAT: Add Label 5520 with 1D barcode - remove 2D barcode --- app/Models/Labels/Sheets/Avery/_5520_B.php | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 app/Models/Labels/Sheets/Avery/_5520_B.php diff --git a/app/Models/Labels/Sheets/Avery/_5520_B.php b/app/Models/Labels/Sheets/Avery/_5520_B.php new file mode 100644 index 0000000000..eb6494e0aa --- /dev/null +++ b/app/Models/Labels/Sheets/Avery/_5520_B.php @@ -0,0 +1,84 @@ +getLabelPrintableArea(); + + $currentX = $pa->x1; + $currentY = $pa->y1; + $usableWidth = $pa->w; + $usableHeight = $pa->h; + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $pa->x1, $pa->y1, + 'freesans', '', self::TITLE_SIZE, 'C', + $pa->w, self::TITLE_SIZE, true, 0 + ); + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + $usableHeight -= self::TITLE_SIZE + self::TITLE_MARGIN; + } + + if ($record->has('barcode1d')) { + static::write1DBarcode( + $pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type, + $pa->x1, $pa->y2 - self::BARCODE_SIZE, + $usableWidth, self::BARCODE_SIZE + ); + $usableHeight -= self::BARCODE_SIZE + self::BARCODE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, $field['label'], + $currentX, $currentY, + 'freesans', '', self::LABEL_SIZE, 'L', + $usableWidth, self::LABEL_SIZE, true, 0 + ); + $currentY += self::LABEL_SIZE + self::LABEL_MARGIN; + + static::writeText( + $pdf, $field['value'], + $currentX, $currentY, + 'freemono', 'B', self::FIELD_SIZE, 'L', + $usableWidth, self::FIELD_SIZE, true, 0, 0.01 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + + } +} + + +?> \ No newline at end of file