#[non_exhaustive]pub struct SaveReport {
pub bytes_written: usize,
pub bytes_appended: usize,
pub objects_written: usize,
pub objects_verbatim: usize,
pub objects_reserialized: usize,
pub byte_identical: bool,
pub delinearized: bool,
pub promoted: Vec<ObjId>,
pub objects_deleted: usize,
pub rc4_keystream_reused: Option<usize>,
}Expand description
What a save actually did — the honest report the CLI, the GUI and the corpus harness all print.
Counters exist for the things that would otherwise be invisible: a save that quietly promoted objects out of an object stream, or that spent a document’s Fast Web View property, has changed something the operator cares about and must say so (“fuzzy, never sneaky”).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bytes_written: usizeTotal bytes in the produced file.
bytes_appended: usizeBytes appended past the base file’s original length. Exactly
0 for an empty-dirty-set incremental save, and equal to
SaveReport::bytes_written for a full rewrite.
objects_written: usizeNumber of object definitions emitted in this save.
objects_verbatim: usizeObjects re-emitted verbatim from their retained source bytes — the §5 invariant’s numerator.
objects_reserialized: usizeObjects that had to be re-serialized from values because they
had no file-level bytes (compressed in an object stream) or
because a policy deliberately rewrote them (/Producer).
Every one of these is a byte-level divergence from the input, and each is counted rather than rounded away (R20-style).
byte_identical: boolWhether the output is byte-identical to the input. Only ever
true for an empty-dirty-set save_incremental.
delinearized: boolWhether this save spent the input’s live Fast Web View property (Annex F.1; R36). Reported, never repaired.
promoted: Vec<ObjId>Objects that were promoted out of an object stream (R38) — counted and named, per decision 007 W3’s mitigation.
A compressed object cannot be written in place, so touching one moves it to file level. That is a representation change to an object whose value the operator may not have edited at all (an identity re-emission promotes too), and it leaves the old value behind inside the untouched container — see this module’s “Promotion, and the stale copy it leaves”. Both facts are things an operator can act on, so neither is rounded away.
promoted.len() is the count; there is deliberately no separate
counter field to fall out of step with the list.
objects_deleted: usizeObjects given a type-0 (free) cross-reference entry by this save — the Pass 3.2 deletion path (§7.5.4, decision 007 W9).
Counted rather than named, unlike SaveReport::promoted,
because a deletion is something the operator asked for and
already knows about, whereas a promotion is a representation
change pdfcer made on its own initiative. The honesty obligation
differs accordingly.
rc4_keystream_reused: Option<usize>Some(n) when this save appended under an RC4 handler
(Rc4Append::Preserve): n edited
objects were re-encrypted under the number and generation, and so the
RC4 keystream, of their previous revision. XOR-ing the two
ciphertexts cancels the keystream. None for every other save.