from pathlib import Path import fitz # type: ignore def make_geometry_pdf(path: Path) -> Path: """Create the same non-empty geometry fixture used for the legacy golden.""" doc = fitz.open() page = doc.new_page(width=792, height=612) page.draw_rect(page.rect, color=(1, 1, 1), fill=(1, 1, 1), width=0) page.draw_rect( fitz.Rect(0, 0, 96, 48), color=(1, 0, 0), fill=(1, 0, 0), width=0, ) page.draw_rect( fitz.Rect(696, 564, 792, 612), color=(0, 0, 1), fill=(0, 0, 1), width=0, ) page.draw_line( fitz.Point(0, 306), fitz.Point(792, 306), color=(0, 0, 0), width=2, ) page.insert_text( (310, 320), "GEOMETRY FIXTURE", fontsize=20, color=(0, 0, 0), ) doc.save(path) doc.close() return path