diff --git a/app.py b/app.py index 690d35b..3a472be 100644 --- a/app.py +++ b/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