#[non_exhaustive]pub enum Compromise {
FontSubstituted {
font: ObjRef,
base_name: String,
substitute: &'static str,
},
ActionRemoved {
holder: ObjRef,
kind: String,
},
AnnotationRemoved {
annotation: ObjRef,
page: u32,
subtype: String,
},
AnnotationFlagsChanged {
annotation: ObjRef,
page: u32,
},
PageRasterized {
page: u32,
dpi: Dpi,
cause: RasterCause,
},
EmbeddedFileRemoved {
file: Option<ObjRef>,
name: String,
},
OptionalContentRemoved {
catalog: ObjRef,
},
ObjectMetadataRemoved {
object: ObjRef,
},
}Expand description
One thing the conversion did that changed the document.
Every variant carries the object or page it happened to, for the same
reason Subject does: a caller that wants to show the user
what changed needs to reach the thing, and a sentence cannot be turned back
into an ObjRef.
This is the complete list of ways the conversion can alter meaning. A
repair that changes nothing a reader would notice — minting a /ID,
writing an output intent, rewriting the XMP packet — is not a compromise
and does not appear here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FontSubstituted
A font’s program was not in the file and could not be obtained, so a standard font was substituted. The glyphs the page draws change.
Never produced yet, like Compromise::PageRasterized: the
substitution behind Policy::unembeddable_font is not implemented.
Both are here rather than added with their repairs because each
completes a triple that is live — the policy field, the Refusal
a caller gets today, and the compromise they will get instead. A
caller writes the match arm once.
Fields
ActionRemoved
An action was removed: JavaScript, or one of the kinds the level forbids by name.
Fields
AnnotationRemoved
An annotation was removed because its subtype is not permitted.
Fields
AnnotationFlagsChanged
An annotation was kept but its flag word was corrected, so it now prints and is visible where it was not.
PageRasterized
A page was rendered to an image and rebuilt around it. Its text is no longer text and its vectors are no longer vectors.
Never produced yet: the rasterizing repair is not implemented.
The variant is part of the vocabulary because
Conversion::rasterized_pages reports which pages changed, and a
caller writes that match arm once, not when the repair lands.
Fields
dpi: DpiThe resolution it was rendered at, in whole dots per inch.
An integer newtype rather than an f32: a fractional render
resolution is not a thing a caller asks for, and f32 would cost
this whole report its Eq.
cause: RasterCauseWhy the page could not be kept as content.
EmbeddedFileRemoved
An embedded file was removed. A-1b forbids them outright.
Fields
OptionalContentRemoved
Optional content was removed, so what was conditionally visible is now
unconditionally so. A-1b forbids /OCProperties.
ObjectMetadataRemoved
A /Metadata packet on an object other than the catalog was removed.
PDF/A’s schema rules apply to every packet in the file, and a packet on an image describing its camera or its rights holder usually uses schemas PDF/A does not predefine. Nothing renders differently without it — it is descriptive metadata, not content — but it is information the file no longer carries, so the caller is told.
Trait Implementations§
Source§impl Clone for Compromise
impl Clone for Compromise
Source§fn clone(&self) -> Compromise
fn clone(&self) -> Compromise
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more