InvenTree: Brother-QL-kompatible 62x27mm Lagerort-Vorlage

Siehe auch die große Version (140x62mm) dieses Labels

Diese InvenTree-Vorlage für Lagerort-Labels ist vollständig kompatibel mit Brother-QL-Etikettendruckern der 62mm-Serie. Zum Drucken unter Linux verwende ich BrotherQLLabelPrintService.

InvenTree 62x27mm stock location

stock_location_62x27.html
{% extends "label/label_base.html" %}
{% load l10n i18n barcode %}

{% block style %}
{% localize off %}
@page {
    size: {{ width }}mm {{ height }}mm;
    margin: 2mm; /* Einheitlicher 2mm-Sicherheitsabstand auf allen Seiten */
}

body {
    margin: 0;
    padding: 0;
}

/* Tabellenlayout garantiert exakte Positionierung und behebt WeasyPrint-Multi-Page-Bugs */
.label-table {
    display: table;
    width: calc({{ width }}mm - 4mm);  /* Volle Breite minus 2mm links und 2mm rechts */
    height: calc({{ height }}mm - 4mm); /* Volle Höhe minus 2mm oben und 2mm unten */
    table-layout: fixed;
    page-break-inside: avoid;
    break-inside: avoid;
}

.label-row {
    display: table-row;
}

.qr-cell {
    display: table-cell;
    width: calc({{ height }}mm - 4mm); /* Hält die QR-Zelle als perfektes Quadrat */
    height: calc({{ height }}mm - 4mm);
    vertical-align: middle;            /* Zentriert den QR-Code vertikal */
}

.qr {
    width: calc({{ height }}mm - 4mm);
    height: calc({{ height }}mm - 4mm);
    display: block;
}

.text-cell {
    display: table-cell;
    width: calc({{ width }}mm - {{ height }}mm); /* Füllt den verbleibenden Platz dynamisch */
    height: calc({{ height }}mm - 4mm);
    vertical-align: middle;                      /* PERFEKTE VERTIKALE ZENTRIERUNG */
    padding-left: 3mm;                           /* Sauberer Abstand zwischen QR-Code und Text */
    box-sizing: border-box;
    overflow: hidden;
}
{% endlocalize %}

.loc {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    line-height: 1.05;
    margin: 0;
    padding: 0;
    
    /* Natives Layout berücksichtigt UTF-8-Soft-Hyphens */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* AUTOMATISCHE SCHRIFTGRÖSSEN-STUFEN (herunterskaliert von ursprünglich 21pt) */
.loc.large { font-size: 21pt; }
.loc.medium { font-size: 15pt; }
.loc.small { font-size: 11pt; }
{% endblock style %}

{% block content %}
<div class="label-table">
    <div class="label-row">
        
        <div class="qr-cell">
            <img class='qr' alt="{% trans 'QR code' %}" src='{% qrcode qr_data %}'>
        </div>
        
        <div class="text-cell">
            <div class="loc {% if location.name|length > 20 %}small{% elif location.name|length > 10 %}medium{% else %}large{% endif %}">
                {{ location.name }}
            </div>
        </div>
        
    </div>
</div>
{% endblock content %}

Ähnliche Beiträge nach Kategorie: InvenTree