Badges: Add export layout for 4x3" on letter (Z#23232464) (#6128)

* Badges: Add export layout for 4x3" on letter (Z#23232464)

* Consistent naming
This commit is contained in:
Raphael Michel
2026-04-29 15:31:54 +02:00
committed by GitHub
parent 589f51454e
commit 24d26a9455
2 changed files with 15 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ from django.utils.translation import gettext as _, gettext_lazy, pgettext_lazy
from pypdf import PageObject, PdfReader, PdfWriter, Transformation
from pypdf.generic import RectangleObject
from reportlab.lib import pagesizes
from reportlab.lib.units import mm
from reportlab.lib.units import inch, mm
from reportlab.pdfgen import canvas
from pretix.base.exporter import BaseExporter
@@ -133,6 +133,14 @@ OPTIONS = OrderedDict([
'offsets': [66.1 * mm, 29.6 * mm],
'pagesize': pagesizes.A4,
}),
('avery_4inx3in', {
'name': 'Avery 4" x 3" (74459)',
'cols': 2,
'rows': 3,
'margins': [1 * inch, .25 * inch, 1 * inch, .25 * inch],
'offsets': [4 * inch, 3 * inch],
'pagesize': pagesizes.LETTER,
}),
('avery_80x50', {
'name': 'Avery Zweckform 80 x 50 mm (L4785)',
'cols': 2,

View File

@@ -22,7 +22,7 @@
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
from reportlab.lib import pagesizes
from reportlab.lib.units import mm
from reportlab.lib.units import inch, mm
def _simple_template(w, h):
@@ -261,4 +261,9 @@ TEMPLATES = {
"pagesize": (88.9 * mm, 33.87 * mm),
"layout": _simple_template(88.9 * mm, 33.87 * mm),
},
"4inx3in": {
"label": format_lazy(_("{width} x {height} inch label"), width=4, height=3),
"pagesize": (4 * inch, 3 * inch),
"layout": _simple_template(4 * inch, 3 * inch),
},
}