Preview
{{ $labelPreset['title'] ?? '' }} — first label at actual size
{{ $labels->count() - 1 }} more in this batch — listed below. All use the same layout.
@elseThis is what will print on each label.
@endif@php /** @var \Illuminate\Support\Collection $labels */ /** @var string $garageName */ /** @var string $labelSize */ /** @var array $labelPreset */ /** @var array $eplLayout */ /** @var string $generatedEpl */ /** @var bool $rotate */ /** @var string $roll */ /** @var string $barDir */ /** @var int $barNarrow */ /** @var float $gapMm */ /** @var float $offsetXmm */ /** @var float $offsetYmm */ /** @var float $pitchMm */ $w = (float) ($labelPreset['w_mm'] ?? 38.0); $h = (float) ($labelPreset['h_mm'] ?? 28.0); $usesWs8240Epl = ! empty($labelPreset['epl_ws8240']); $eplLayout = $eplLayout ?? []; $wDots = (int) ($eplLayout['q'] ?? 304); $hDots = (int) ($eplLayout['label_len'] ?? 224); $gapDots = (int) ($eplLayout['gap'] ?? 24); $eplTextX = (int) ($eplLayout['text_x'] ?? 20); $eplTextY = (int) ($eplLayout['text_y'] ?? 20); $eplBarX = (int) ($eplLayout['bar_x'] ?? 20); $eplBarY = (int) ($eplLayout['bar_y'] ?? 60); $eplBarH = (int) ($eplLayout['bar_h'] ?? 80); $eplBarNarrow = (int) ($eplLayout['bar_narrow'] ?? 2); $rotate = (bool) ($rotate ?? false); $roll = (string) ($roll ?? ($usesWs8240Epl ? 'vertical' : ($rotate ? 'vertical' : 'horizontal'))); if (! in_array($roll, ['horizontal', 'vertical'], true)) { $roll = $usesWs8240Epl ? 'vertical' : 'horizontal'; } $barDir = (string) ($barDir ?? 'horizontal'); if ($usesWs8240Epl || $w < 45) { $barDir = 'horizontal'; } elseif (! in_array($barDir, ['horizontal', 'vertical'], true)) { $barDir = 'horizontal'; } $barNarrow = (int) ($barNarrow ?? 2); $barNarrow = max(1, min(4, $barNarrow)); $gapMm = (float) ($gapMm ?? 3.0); $pitchMm = (float) ($pitchMm ?? $h); $offsetXmm = (float) ($offsetXmm ?? 0.0); $offsetYmm = (float) ($offsetYmm ?? 0.0); // WS8240 / 40×25: EPL always rotation 0 — preview matches physical label, no CSS rotate. $isHorizRoll = $roll === 'horizontal'; $pageW = $w; $pageH = $h; $cssRotateLabel = $usesWs8240Epl ? false : ! $isHorizRoll; $cssRotateBarcode = $usesWs8240Epl ? false : ($barDir === 'vertical' && $isHorizRoll); $fmt = function ($v) { return rtrim(rtrim(number_format($v, 3, '.', ''), '0'), '.'); }; $wCss = $fmt($w); $hCss = $fmt($h); $pageWCss = $fmt($pageW); $pageHCss = $fmt($pageH); $isSmall = ($w < 45) || ($h < 24); $isTiny = ($w < 35) || ($h < 22); $padV = $isTiny ? 0.8 : ($isSmall ? 1.0 : 1.2); $padH = $isTiny ? 0.8 : ($isSmall ? 1.0 : 1.2); $garageReserve = $isTiny ? 2.6 : ($isSmall ? 3.0 : 3.4); $codeReserve = $isTiny ? 2.2 : ($isSmall ? 2.6 : 3.0); $gapReserve = $isTiny ? 0.3 : 0.4; $barAreaH = max(7.0, $h - (2 * $padV) - $garageReserve - $codeReserve - $gapReserve); $barAreaHCss = $fmt($barAreaH); $padVCss = $fmt($padV); $padHCss = $fmt($padH); $gapCss = $fmt($gapMm); $pitchCss = $fmt($pitchMm); $offXCss = $fmt($offsetXmm); $offYCss = $fmt($offsetYmm); @endphp
{{ $labelPreset['title'] ?? '' }} — first label at actual size
{{ $labels->count() - 1 }} more in this batch — listed below. All use the same layout.
@elseThis is what will print on each label.
@endif