enonce_info.py

This commit is contained in:
2026-07-09 15:54:36 +02:00
parent 121bd0714a
commit fd35675e4c
6 changed files with 619 additions and 180 deletions
+6 -5
View File
@@ -9,18 +9,19 @@ import threading
import annotating
from utils import natural_key
from utils import natural_key, pdf_image_of_enonce, pdf_image_of_solution
from reading_annotations import detect_checks_and_notes, has_significant_notes
def get_extra_pdfs_as_images(root_dir, label, annotating_module):
"""Fetches Text and Sol pdfs for a given label and converts them to images."""
extra_images = []
for folder in ["Text", "Sol"]:
pdf_path = os.path.join(root_dir, folder, f"{label}.pdf")
if os.path.exists(pdf_path):
img, _, _ = annotating_module.make_base_image(pdf_path)
a, b = pdf_image_of_enonce(root_dir, label), pdf_image_of_solution(root_dir, label)
for c in [a, b]:
if c:
img, _, _ = annotating_module.make_base_image(c)
if img:
extra_images.append(img)
return extra_images
def save_paginated_pdf(image_groups, output_path):