#[non_exhaustive]pub enum BoxResolution {
Defaulted,
AsWritten,
Clipped,
Unusable,
}Expand description
How a resolved page box (Page::crop_box, Page::bleed_box,
Page::trim_box, Page::art_box) relates to what the file wrote.
ISO 32000-2 §14.11.2.1: “If the bounds of the crop, trim, bleed or art
box extends outside of the bounds of the media box, a processor shall
treat the box as its intersection with the media box.” Every resolved
box is therefore already clipped to Page::media_box; this says
whether that changed anything. Report anything but Defaulted /
AsWritten off-canvas (project rule 4) — the file is not rewritten.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Defaulted
The file wrote no such box (nor, for CropBox, did an ancestor);
the Table 30 default is in use.
AsWritten
The written box lies inside the media box and is used unchanged.
Clipped
The written box extended beyond the media box and was reduced to the intersection.
Unusable
The written box could not be used and the Table 30 default is in use instead: its intersection with the media box has no area (the spec leaves this undefined, PB-A1), or — for the three non-inheritable boxes only — it is not a four-number array.
Falling back to the default rather than framing an empty page is pdfcer’s choice for PB-A1; a caller that wants the other answer (render nothing) can act on this variant.