diff --git a/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape.php b/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape.php new file mode 100644 index 000000000000..2069927a3445 --- /dev/null +++ b/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape.php @@ -0,0 +1,23 @@ +getUnit()); } + public function getMarginTop() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit()); } + public function getMarginBottom() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit());} + public function getMarginLeft() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); } + public function getMarginRight() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); } + public function getRotation() { return 90; } +} diff --git a/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php b/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php new file mode 100644 index 000000000000..8a700d1a9c69 --- /dev/null +++ b/app/Models/Labels/Tapes/Brother/TZe_62mm_Landscape_A.php @@ -0,0 +1,106 @@ +getPrintableArea(); + + $currentX = $pa->x1; + $currentY = $pa->y1; + + // Wide 1D barcode on top + + if ($record->has('barcode1d')) { + static::write1DBarcode( + $pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type, + $currentX, $currentY, $pa->w, self::BARCODE1D_HEIGHT + ); + $currentY = self::BARCODE1D_HEIGHT + self::BARCODE1D_MARGIN; + } + + // Left column + + if ($record->has('barcode2d')) { + $columnY = $currentY; + static::write2DBarcode( + $pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type, + $currentX, $columnY, + self::BARCODE2D_SIZE, self::BARCODE2D_SIZE + ); + $columnY += self::BARCODE2D_SIZE + self::BARCODE2D_MARGIN; + static::writeText( + $pdf, $record->get('tag'), + $currentX, $columnY, + 'freemono', 'b', self::TAG_SIZE, 'C', + self::BARCODE2D_SIZE, self::TAG_SIZE, true, 0 + ); + $currentX += self::BARCODE2D_SIZE + self::BARCODE2D_MARGIN; + } + + // Right column + if ($record->get('logo')) { + $logoSize = static::writeImage( + $pdf, $record->get('logo'), + $currentX, $currentY, + $pa->w - $currentX, self::LOGO_HEIGHT, + 'L', 'T', 300, true, false, 0 + ); + $currentY += self::LOGO_HEIGHT + self::LOGO_MARGIN; + } + + if ($record->has('title')) { + static::writeText( + $pdf, $record->get('title'), + $currentX, $currentY, + 'freesans', '', self::TITLE_SIZE, 'L', + $pa->w - $currentX, self::TITLE_SIZE, true, 0 + ); + $currentY += self::TITLE_SIZE + self::TITLE_MARGIN; + } + + foreach ($record->get('fields') as $field) { + static::writeText( + $pdf, $field['label'], + $currentX, $currentY, + 'freesans', '', self::LABEL_SIZE, 'L', + $pa->w - $currentX, self::LABEL_SIZE, true, 0, 0 + ); + $currentY += self::LABEL_SIZE + self::LABEL_MARGIN; + + static::writeText( + $pdf, $field['value'], + $currentX, $currentY, + 'freemono', 'B', self::FIELD_SIZE, 'L', + $pa->w - $currentX, self::FIELD_SIZE, true, 0, 0.3 + ); + $currentY += self::FIELD_SIZE + self::FIELD_MARGIN; + } + } +}