class PDF::Reader::ValidatingReceiver

Page#walk will execute the content stream of a page, calling methods on a receiver class provided by the user. Each operator has a specific set of parameters it expects, and we wrap the users receiver class in this one to verify the PDF uses valid parameters.

Without these checks, users can’t be confident about the number of parameters they’ll receive for an operator, or what the type of those parameters will be. Everyone ends up building their own type safety guard clauses and it’s tedious.

Not all operators have type safety implemented yet, but we can expand the number over time.