{% extends "labels/base.html" %} {% block style %} @page { size: {{ paper_width }}mm {{ paper_height }}mm; margin: 8.4mm 5mm 8.5mm 5.2mm; } /* Prevent outputting more than one page (workaround) */ body { height: {{body_height}}; } .name { border-bottom: 1.5px solid black; display: flex; flex-direction: column; min-height: 4mm; text-align: center; overflow-wrap: break-word; } .info { border-bottom: 1.5px solid black; text-align: center; overflow-wrap: break-word; } .qrcodebox { display: flex; flex-direction: column; align-items: center; font-size: 8px; padding-top: 1mm; } .innerbox { display: flex; align-items: center; } .qrcodebox span { width: 100%; display: block; text-align: center; } .thirdbox .qrcodebox div { width: 15.25mm; height: 16mm; background-size: contain; margin: 0mm -0.5mm -0.75mm; background-repeat: no-repeat; } .fourthbox .qrcodebox div { width: 17mm; height: 17.5mm; background-size: contain; } .fifthbox .qrcodebox div { width: 17mm; height: 17mm; background-size: contain; } .sixthbox .qrcodebox div { width: 17mm; height: 17mm; background-size: contain; } .firstbox { margin: {{horizontal_label_margin - 0.2}}mm {{vertical_label_margin}}mm {{horizontal_label_margin}}mm {{vertical_label_margin}}mm; display: flex; align-items: center; border: 1.5px solid black; height: 8.6mm; } .secondbox { margin: {{vertical_label_margin - 0.45}}mm {{vertical_label_margin}}mm; display: flex; flex-direction: row; align-items: center; border: 1.5px solid black; height: 12.6mm; } .firstbox, .secondbox { max-width: {{ paper_width - 16.9 }}mm; } .firstbox .labeltext, .secondbox .labeltext { overflow-x: hidden; white-space: nowrap; text-overflow: ellipsis; } .thirdbox { margin: 2.5mm 1.95mm 0mm 0mm; border: 1.5px solid black; display: inline-block; flex-direction: column; align-items: center; min-height: 51.5mm; } .thirdbox .name { width: {{third_box_width - 0.4}}mm; padding: 0.5mm 0.2mm 0.5mm 0.2mm; } .thirdbox .info { min-height: 9mm; width: {{third_box_width}}mm; padding: 0.75mm 0mm; } .ghsbox { position: relative; } .centeredghsbox { position: relative; width: {{ ghs_width * 2 }}mm; margin: 0 auto; } .fourthbox { margin: 2.5mm {{vertical_label_margin - 0.55}}mm; display: inline-block; flex-direction: column; align-items: center; border: none; margin-bottom: 0mm; border: 1.5px solid black; min-height: 51.65mm; } .fourthbox .name { width: {{forth_box_width - 0.4}}mm; padding: 0.5mm 0.2mm 0.5mm 0.2mm; } .fourthbox .info { min-height: 4mm; padding: 0.75mm 0mm; } .fourthbox .qrcodebox { border-top: none; } .fifthbox { margin: 2.5mm {{vertical_label_margin - 0.55}}mm; border: 1.5px solid black; align-items: center; display: inline-block; min-height: 30mm } .fifthbox .name { width: {{fifth_box_width - 0.4}}mm; padding: 0.5mm 0.2mm 0.4mm 0.2mm; } .fifthbox .info { min-height: 7.25mm; padding-top: 0.75mm; } .sixthbox { margin: {{horizontal_label_margin}}mm {{vertical_label_margin - 0.5}}mm; align-items: center; min-height: 30mm; display: inline-block; border: 1.5px solid black; width: {{sixth_box_width}}mm; } .sixthbox .name { width: {{sixth_box_width - 0.4}}mm; padding: 0.5mm 0.2mm 0.4mm 0.2mm; } .sixthbox .info { min-height: 7.25mm; padding-top: 0.75mm; } .sixthbox .qrcodebox { border-right: 1.5px solid black; width: {{sixth_box_qrcode_box_width}}mm; } .sixthbox .ghsbox { border-right: 1.5px solid black; width: {{sixth_box_ghs_box_width}}mm; } .ghsbox .ghs { position: absolute; } .ghsbox .ghs:nth-child(1) { top: 1.5mm; } .ghsbox .ghs:nth-child(2), .ghsbox .ghs:nth-child(3) { top: 6mm; } .ghsbox .ghs:nth-child(4) { top: 10.5mm; } .ghsbox .ghs:nth-child(5), .ghsbox .ghs:nth-child(6) { top: 15mm; } .ghsbox .ghs:nth-child(7) { top: 19.5mm; } .ghsbox .ghs:nth-child(8), .ghsbox .ghs:nth-child(9) { top: 24mm; } .ghsbox .ghs:nth-child(1), .ghsbox .ghs:nth-child(4), .ghsbox .ghs:nth-child(7) { left: {{ ghs_width / 2 }}mm; } .ghsbox .ghs:nth-child(3), .ghsbox .ghs:nth-child(6), .ghsbox .ghs:nth-child(9) { left: {{ ghs_width }}mm; } /* special case with only two GHS symbols */ .centeredghsbox .ghs:nth-child(1):nth-last-child(2), .centeredghsbox .ghs:nth-child(2):nth-last-child(1) { top: 1.5mm; } .centeredghsbox .ghs:nth-child(1):nth-last-child(2) { left: 0; } .centeredghsbox .ghs:nth-child(2):nth-last-child(1) { left: {{ ghs_width }}mm; } .outerbox_first_or_second_label { display: flex; } .extrabox { position: absolute; display: flex; align-items: center; } .firstbox .extrabox { top: -0.75mm; } .secondbox .extrabox { top: -0.9mm; } .extrabox .qrcode { background-position: right center; margin-right:-1.25mm; } .outerbox { margin: 0.125mm 2.5mm 0.25mm; border: none; width: {{outer_box_width}}mm; min-height: 52mm; } .outerbox > div { display: inline-block; vertical-align: top; } .groupbox { width: {{ paper_width - 2 * horizontal_label_margin}}mm; break-inside: avoid; line-height: 3.325mm; } {% endblock %} {% block body %} {% for object_index in range(0,object_amount) %} {% for i in range(0,set_amount) %}