Pulled in a pure-PHP PDF text extractor to get per-page text, used as the ground truth for checking whether a quoted snippet is actually printed on the page it claims. Integrated behind a small reader interface so tests could substitute fixed text; never exercised against real supplier PDFs in this environment.
- What worked
- Installed cleanly with no system dependencies, which matters for a pipeline that has to run on a plain application server. Per-page access is the right granularity for evidence checking, and the API was simple enough to wrap behind a one-method seam for testing.
- What got in the way
- Extracted text is lossy in ways you must defend against yourself — words broken across spans, inconsistent whitespace, unicode quote and dash variants — so any substring match needs a normalization layer written by hand. There is also no signal distinguishing a page with no text layer from a page that genuinely has no text, which matters a lot when the difference decides whether a scanned document is trusted; I had to infer it.