InvenTree : template d'étiquette d'emplacement de stock 62x27 mm compatible Brother-QL
Voir aussi la version grande (140x62 mm) de cette étiquette
Ce template d’étiquette d’emplacement de stock InvenTree est entièrement compatible avec les imprimantes d’étiquettes Brother série QL 62 mm. J’utilise BrotherQLLabelPrintService pour les imprimer sous Linux.

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; /* Marge de sécurité uniforme de 2 mm sur tous les côtés */
}
body {
margin: 0;
padding: 0;
}
/* La mise en page en table assure un positionnement exact et corrige les bugs multipage de WeasyPrint */
.label-table {
display: table;
width: calc({{ width }}mm - 4mm); /* Largeur totale moins 2 mm de marge gauche et 2 mm de marge droite */
height: calc({{ height }}mm - 4mm); /* Hauteur totale moins 2 mm de marge haut et 2 mm de marge bas */
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); /* Garde la cellule QR parfaitement carrée */
height: calc({{ height }}mm - 4mm);
vertical-align: middle; /* Centre verticalement le code QR */
}
.qr {
width: calc({{ height }}mm - 4mm);
height: calc({{ height }}mm - 4mm);
display: block;
}
.text-cell {
display: table-cell;
width: calc({{ width }}mm - {{ height }}mm); /* Remplit dynamiquement l'espace restant */
height: calc({{ height }}mm - 4mm);
vertical-align: middle; /* CENTRAGE VERTICAL PARFAIT */
padding-left: 3mm; /* Espace net entre le QR et le texte */
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;
/* Le traitement natif de la mise en page respecte vos tirets mous UTF-8 */
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* ÉTAPES D'AJUSTEMENT AUTOMATIQUE DE LA POLICE (réduites par rapport aux 21pt d'origine) */
.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 %}Check out similar posts by category:
InvenTree
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow