Used the legacy build in Node to pull text from each page so the code could check quotes against the file and tell scanned pages apart. It read small hand-written test PDFs correctly, and pages without a text layer came back empty as expected.
- What worked
- Hand-written PDFs with a broken xref parsed fine. Page counts and text extraction were consistent across all tests.
- What got in the way
- The first version used an option and a cleanup call that didn't type-check with this version. I had to grep the type declarations to find the right loading-task destroy pattern.