Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

docs(filters, model): record the filter chain and inherited copy limits

aiongg735fb8e661f3
diff --git a/crates/filters/README.md b/crates/filters/README.md
index df64e4b7c..fc5306e32 100644
--- a/crates/filters/README.md
+++ b/crates/filters/README.md
@@ -23,7 +23,7 @@ encode_flate(data) -> Vec<u8> // zlib, level 6
```
- `chain` is applied first to last, as in a `/Filter` array.
-- Image codecs (DCT, JPX, JBIG2, CCITT), `Crypt` and unknown filters anywhere in a chain give `Unsupported`: callers keep such data encoded. Decryption belongs to `crypt`.
+- Image codecs (DCT, JPX, JBIG2, CCITT), `Crypt` and unknown filters anywhere in a chain give `Unsupported`: callers keep such data encoded. So does a chain longer than `MAX_CHAIN` (8) filters, before any stage runs. Decryption belongs to `crypt`.
- `max_output` bounds every intermediate buffer (including the pre-predictor buffer) and gives `LimitExceeded(max_output)`. This also holds when Flate retries raw deflate after a misleading zlib header, in both strict and tolerant decoding.
- `decode_tolerant` turns `Corrupt` into "what was decoded so far" plus `partial = true`, then runs the rest of the chain on it (predictors are applied to partial output too). `LimitExceeded` and `Unsupported` are still errors.
diff --git a/crates/model/README.md b/crates/model/README.md
index bfc6e42e3..09a060391 100644
--- a/crates/model/README.md
+++ b/crates/model/README.md
@@ -17,6 +17,9 @@ L3/L4 crates need:
The page-tree walk keeps one cursor per ancestor and shares inherited attribute owners.
Repeated child references are skipped before copying attributes, with first depth-first
occurrence order preserved. Returned page dictionaries still own their effective attributes.
+A walk copies at most `MAX_INHERITED_COPIES` (1 GiB, approximate heap bytes) of inherited
+values into the leaves; past it the walk stops, as it does past its leaf cap, and the pages
+after that point are not listed.
`organize`, `annot` and `forms` still carry their own small walkers; they move here as the model
grows (ADR-0004).