This commit is contained in:
zman 2025-04-08 11:55:30 -04:00
parent a37918fe11
commit fa71c39780

24
app.py
View File

@ -57,18 +57,18 @@ def convert_pdf_to_images(pdf_path):
# Function to print address labels
def print_address_label(images, pdf_path):
try:
if 'address' in pdf_path.lower():
target_width = 1660
target_height = 1164
image = image.convert("RGB")
image = image.resize((target_width, target_height), Image.LANCZOS)
image = image.rotate(90, expand=True)
else:
target_width = 1164
target_height = 1660
image = image.convert("RGB")
image = image.resize((target_width, target_height), Image.LANCZOS)
for image in images:
if 'address' in pdf_path.lower():
target_width = 1660
target_height = 1164
image = image.convert("RGB")
image = image.resize((target_width, target_height), Image.LANCZOS)
image = image.rotate(90, expand=True)
else:
target_width = 1164
target_height = 1660
image = image.convert("RGB")
image = image.resize((target_width, target_height), Image.LANCZOS)
qlr = BrotherQLRaster(printer_model)
qlr.exception_on_warning = True