#[non_exhaustive]pub enum Linearization {
None,
Live {
declared_length: u64,
},
Stale {
declared_length: u64,
actual_length: u64,
},
}Expand description
What Annex F detection concluded about a loaded file.
Three states, not two, because “was linearized and then updated” is operationally different from both “is linearized” and “never was”: it is the state in which a previous save already spent the Fast Web View property, so pdfcer has nothing left to warn about.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
No /Linearized parameter dictionary in the first
LINEARIZATION_SCAN_WINDOW bytes.
Live
/Linearized present and L equals the actual file length:
the hint tables are trustworthy and Fast Web View is live.
This is the state a save must warn about (R36).
Stale
/Linearized present but L disagrees with the file length.
Per F.1 the file “shall be treated as ordinary PDF”. The two
sub-cases are distinguished because they mean different things:
a file longer than L had an update appended (G.7’s case);
a file shorter than L is truncated, i.e. damaged.
Implementations§
Source§impl Linearization
impl Linearization
Sourcepub const fn save_invalidates_fast_web_view(self) -> bool
pub const fn save_invalidates_fast_web_view(self) -> bool
Whether a save would destroy a live Fast Web View property — i.e. whether the operator is owed a warning (R36).
False for Linearization::Stale: the property was already
spent by whoever appended the previous update, and warning about
a loss that already happened is noise, not honesty.