Merge pull request #2776 from SchrodingersGat/printer-dimensions

Supply label width and height to the label printing plugin
This commit is contained in:
Oliver 2022-03-26 16:57:11 +11:00 committed by GitHub
commit 1bdebe1324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -419,6 +419,10 @@ class LabelPrintingMixin:
Arguments:
label: A black-and-white pillow Image object
kwargs:
length: The length of the label (in mm)
width: The width of the label (in mm)
"""
# Unimplemented (to be implemented by the particular plugin class)

View File

@ -217,7 +217,7 @@ def print_label(plugin_slug, label_image, label_instance=None, user=None):
return
try:
plugin.print_label(label_image)
plugin.print_label(label_image, width=label_instance.width, height=label_instance.height)
except Exception as e:
# Plugin threw an error - notify the user who attempted to print