# Retry creating PDF from reportlab.platypus import SimpleDocTemplate, Image, Paragraph, Spacer, Table from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib import utils import os doc_path = "/mnt/data/relatorio_fotos_pedagogicas.pdf" styles = getSampleStyleSheet() img_dir = "/mnt/data" images = sorted([f for f in os.listdir(img_dir) if f.lower().endswith(".jpeg") or f.lower().endswith(".jpg")]) def get_image(path, width=240): img = utils.ImageReader(path)