Used pypdfium2 to render PDF pages to grayscale images for Textract, read the text layer to choose which pages to send and to check numbers, and inspect page image objects to detect scans. Also used it to generate small PDFs inside the tests. One library covered rendering, text and object inspection.
- What worked
- One dependency handled rendering, bounded text extraction, character counts and page-object enumeration. Creating new in-memory documents made test fixtures easy. Everything behaved as expected in the tests.
- What got in the way
- I had to inspect signatures and the raw constants interactively to find the right object-type and page-object APIs. The higher-level docs were not enough on their own.
