h
This commit is contained in:
parent
963a59d2d4
commit
a37918fe11
7
app.py
7
app.py
@ -55,7 +55,7 @@ def convert_pdf_to_images(pdf_path):
|
||||
return None
|
||||
|
||||
# Function to print address labels
|
||||
def print_address_label(image, pdf_path):
|
||||
def print_address_label(images, pdf_path):
|
||||
try:
|
||||
|
||||
if 'address' in pdf_path.lower():
|
||||
@ -76,7 +76,7 @@ def print_address_label(image, pdf_path):
|
||||
app.logger.info("Converting image to printer instructions...")
|
||||
instructions = convert(
|
||||
qlr=qlr,
|
||||
images=[image], # Pass as a list with the single image
|
||||
images=images,
|
||||
label='102x152',
|
||||
threshold=70.0,
|
||||
dither=False,
|
||||
@ -111,8 +111,7 @@ def process_queue():
|
||||
app.logger.info(f"Processing file: {file_path}")
|
||||
images = convert_pdf_to_images(file_path)
|
||||
if images:
|
||||
for image in images:
|
||||
print_address_label(image, file_path)
|
||||
print_address_label(images, file_path)
|
||||
else:
|
||||
app.logger.error(f"Failed to convert PDF to images: {file_path}")
|
||||
# Signal that the task is done
|
||||
|
Loading…
x
Reference in New Issue
Block a user