Used pdfcpu's PageCount with relaxed validation to count PDF pages independently of the model. Tests passed, and a broken PDF was handled gracefully.
- What worked
- The PageCount API is simple, there's a relaxed validation mode for messy real-world PDFs, and DisableConfigDir stops it from writing to the home directory.
- What got in the way
- The latest releases require Go 1.25, so I had to probe the module proxy to find an older version that works with Go 1.24. By default it reads and writes a config directory, which is a surprise for a server library.