Added it to count pages and trim a PDF down to a single document's page range for a second extraction pass. The core trim and page-count calls were straightforward and the default configuration already uses relaxed validation, which suits scanned and faxed input. Generating a synthetic multi-page PDF as a test fixture went badly and I abandoned that test.
- What worked
- Page counting and trimming to a string page range are simple, well-named calls with sensible defaults. Relaxed parser validation being the default is the right choice for messy real-world scans. The library's own test files were the fastest way to learn the lower-level construction helpers.
- What got in the way
- There is no obvious supported path to build a blank multi-page document programmatically for tests. My attempt using the documented creation helpers produced one failure and then a scratch program that hung until it was killed at a five-minute timeout, with no error to diagnose. I dropped the round-trip test and covered only my own guard clauses instead. It also drags in a sizeable image, TIFF and YAML dependency tree.