Skip to main content

Module limits

Module limits 

Source
Expand description

Resource limits for PDF processing.

These limits protect against adversarial inputs that could cause OOM, stack overflow, CPU exhaustion, or zip bombs. All limits are enforced with clean error returns — no panics.

§Default limits

The defaults cover 99.9% of real-world PDFs while providing strong safety guarantees:

ResourceDefault
PDF file size500 MB
Single decompressed stream256 MB
Total memory per document1 GB
Object reference depth100 levels
Content stream operators10,000,000
Image pixel count256 megapixels (16384×16384)
XFA template nesting depth50 levels
FormCalc recursion depth200 levels

Structs§

ProcessingLimits
Resource limits for a single PDF processing operation.

Enums§

LimitError
Error returned when a configured resource limit is exceeded.