Autosave: 20260521-201042

This commit is contained in:
Flatlogic Bot 2026-05-21 20:10:43 +00:00
parent f06e0c415c
commit 1a7ea8d1c8
3 changed files with 28 additions and 32 deletions

View File

@ -16,7 +16,7 @@ if (empty($codes)) {
<title>Imprimir Etiquetas Térmicas</title>
<style>
body {
font-family: Arial, sans-serif;
font-family: Verdana, sans-serif;
margin: 0;
padding: 0;
display: flex;
@ -66,13 +66,13 @@ if (empty($codes)) {
align-items: center;
overflow: hidden;
text-align: center;
padding: 5mm 1mm 1mm 1mm; /* Aumentado de 3mm a 5mm para bajar más el contenido */
padding: 5mm 1mm 1mm 1mm; /* Restaurado a 5mm para bajar el contenido */
border: 0.1mm solid #eee; /* Guía visual en pantalla */
}
.producto-nombre {
font-size: 6px;
font-weight: bold;
font-weight: normal;
line-height: 1;
margin-bottom: 1mm;
text-transform: uppercase;
@ -83,27 +83,27 @@ if (empty($codes)) {
}
.barcode-container {
height: 9mm; /* Reducido de 11mm a 9mm */
height: 9mm; /* Revertido a 9mm */
display: flex;
justify-content: center;
align-items: center;
margin: 1mm 0; /* Margen vertical */
padding: 0 1mm; /* Reducido de 2mm a 1mm para maximizar grosor de barras */
padding: 0 1mm;
box-sizing: border-box;
width: 100%; /* Ocupa el ancho de la etiqueta para centrar */
}
.barcode-container svg {
height: 9mm;
height: 9mm; /* Revertido a 9mm */
width: auto;
shape-rendering: crispEdges;
display: block;
margin: 0 auto;
shape-rendering: crispEdges;
}
.sku-text {
font-size: 7px;
font-weight: bold;
font-weight: normal;
margin-top: 0.5mm;
letter-spacing: 0.5px;
}
@ -152,9 +152,8 @@ if (empty($codes)) {
<div class="producto-nombre"><?php echo htmlspecialchars($name); ?></div>
<div class="barcode-container">
<?php
// widthFactor 0.8 + altura 72 en el SVG, escalado a 9mm en CSS
// resulta en una barra mínima de ~0.1mm (9 / 72 * 0.8)
echo $generator->getBarcode($code, 0.8, 72);
// widthFactor 1.1 para barras más negras/gruesas sin perder escaneo
echo $generator->getBarcode($code, 1.1, 72);
?>
</div>
<div class="sku-text"><?php echo htmlspecialchars($code); ?></div>

View File

@ -17,7 +17,7 @@ class BarcodeGenerator
if (!$barcodeData) return '';
$bars = '';
$quietZone = 10; // 10 modules of quiet zone
$quietZone = 10;
$x = $quietZone;
$barArray = str_split($barcodeData['bars']);
@ -30,7 +30,7 @@ class BarcodeGenerator
}
$totalWidth = $x + $quietZone;
$svg = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="' . $totalWidth . '" height="' . $height . '" viewBox="0 0 ' . $totalWidth . ' ' . $height . '" preserveAspectRatio="none">';
$svg = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="' . $totalWidth . '" height="' . $height . '" viewBox="0 0 ' . $totalWidth . ' ' . $height . '">';
$svg .= '<rect width="' . $totalWidth . '" height="' . $height . '" style="fill:white;" />';
$svg .= $bars;
$svg .= '</svg>';

View File

@ -10,7 +10,7 @@ $generator = new BarcodeGenerator();
<title>Prueba Etiquetas 3x3 - Especificaciones Exactas</title>
<style>
body {
font-family: Arial, sans-serif;
font-family: Verdana, sans-serif;
margin: 0;
padding: 0;
display: flex;
@ -61,12 +61,12 @@ $generator = new BarcodeGenerator();
align-items: center;
overflow: hidden;
text-align: center;
padding: 5mm 1mm 1mm 1mm; /* Aumentado de 3mm a 5mm para bajar más el contenido */
padding: 5mm 1mm 1mm 1mm; /* Restaurado a 5mm para bajar el contenido */
}
.producto-nombre {
font-size: 6px;
font-weight: bold;
font-weight: normal;
line-height: 1;
margin-bottom: 1mm;
text-transform: uppercase;
@ -77,27 +77,27 @@ $generator = new BarcodeGenerator();
}
.barcode-container {
height: 9mm; /* Reducido de 11mm a 9mm */
height: 9mm; /* Revertido a 9mm */
display: flex;
justify-content: center;
align-items: center;
margin: 1mm 0;
padding: 0 1mm; /* Reducido de 2mm a 1mm para maximizar grosor de barras */
padding: 0 1mm;
box-sizing: border-box;
width: 100%;
}
.barcode-container svg {
height: 9mm;
height: 9mm; /* Revertido a 9mm */
width: auto;
shape-rendering: crispEdges;
display: block;
margin: 0 auto;
shape-rendering: crispEdges;
}
.sku-text {
font-size: 7px;
font-weight: bold;
font-weight: normal;
margin-top: 0.5mm;
letter-spacing: 0.5px;
}
@ -140,9 +140,8 @@ $generator = new BarcodeGenerator();
<div class="producto-nombre">PRODUCTO <?php echo $sku; ?></div>
<div class="barcode-container">
<?php
// widthFactor 0.8 + altura 72 en el SVG, escalado a 9mm en CSS
// resulta en una barra mínima de ~0.1mm (9 / 72 * 0.8)
echo $generator->getBarcode($sku, 0.8, 72);
// widthFactor 1.1 para barras más negras/gruesas sin perder escaneo
echo $generator->getBarcode($sku, 1.1, 72);
?>
</div>
<div class="sku-text"><?php echo $sku; ?></div>
@ -151,15 +150,13 @@ $generator = new BarcodeGenerator();
</div>
<div class="no-print" style="max-width: 500px; background: white; padding: 15px; border-radius: 8px; margin-top: 20px; font-size: 13px; line-height: 1.4; border: 1px solid #ddd;">
<p style="margin-top: 0;"><strong> Especificaciones Aplicadas:</strong></p>
<p style="margin-top: 0;"><strong> Ajustes de Escaneo y Compatibilidad:</strong></p>
<ul style="text-align: left; padding-left: 20px;">
<li><b>Tipo:</b> CODE 128 (Modo B Estándar)</li>
<li><b>Fuente:</b> Arial (Solicitado por el usuario)</li>
<li><b>Altura:</b> 9 mm</li>
<li><b>Posición:</b> Bajado (Padding superior 5mm)</li>
<li><b>Margen lateral:</b> 1 mm</li>
<li><b>Ancho barra mínima:</b> ~0.1mm (Factor 0.8)</li>
<li><b>Estado:</b> Revertido a factor 0.8 con fuente Arial</li>
<li><b>Fuente:</b> Cambiada a <b>Verdana</b> (más legible en impresoras térmicas).</li>
<li><b>Texto:</b> Grosor mantenido en "normal" para evitar empaste.</li>
<li><b>Barras más negras:</b> Aplicado <code>crispEdges</code> para máxima nitidez.</li>
<li><b>Ancho de Barra:</b> Factor 1.1 (ligeramente más gruesas para mayor contraste).</li>
<li><b>Altura:</b> 9mm.</li>
</ul>
</div>