Skip to content

Typed failures for precise PDF output

NextPDF uses typed failures and fail-closed defaults to define clear boundaries for unsupported operations.

PDF is a mature, strict format. Unsupported operations need an explicit boundary because a plausible-looking file can still carry the wrong result. NextPDF reports that boundary at call time.

NextPDF makes format constraints explicit in its API.

Typed boundaries

An unsupported colour space, an unsatisfied signature constraint, or an unparseable input produces a typed error that names the boundary and carries a stack trace at call time.

This is a deliberate trade. It makes the easy path slightly stricter and the hard path explicit. For software that signs contracts and produces compliance artifacts, it is the appropriate trade.

Fail-closed security defaults

Security-relevant defaults fail closed. A signature operation enforces its stated profile and returns a typed failure at that boundary. Redaction proceeds after the engine verifies removal of the original bytes.

Types as documentation

NextPDF is written in strict, modern PHP, with CI configured to run PHPStan at Level 10. Its types encode the permitted operations, catching a class of misuse during analysis instead of in production.

This trade favors explicit boundaries for legal-document output.