pub struct PdfVersion { /* private fields */ }Expand description
A PDF major/minor version paired with an optional extension level.
Implementations§
Source§impl PdfVersion
impl PdfVersion
Sourcepub const fn new(major: i32, minor: i32, extension_level: i64) -> Self
pub const fn new(major: i32, minor: i32, extension_level: i64) -> Self
Creates a PDF version value.
qpdf’s PDFVersion stores major_version/minor_version as int
(include/qpdf/PDFVersion.hh:60-62), not a narrower type.
Sourcepub fn parse(value: &str) -> Option<Self>
pub fn parse(value: &str) -> Option<Self>
Parses the existing flpdf M.m version syntax with extension level 0.
This has no qpdf counterpart (unlike the crate-internal digit-run
prefix parser mirroring QPDF::getVersionAsPDFVersion’s regex and
i32 range), so it keeps its pre-existing u8-bounded numeric range
deliberately: a major or minor run of 3+ digits still parses to
None, matching this function’s own prior behavior rather than
widening as a side effect of PdfVersion’s field type.
Sourcepub fn update_if_greater(&mut self, other: Self)
pub fn update_if_greater(&mut self, other: Self)
Replaces this value when other is greater.
Sourcepub fn get_version(self) -> (String, i64)
pub fn get_version(self) -> (String, i64)
Returns the M.m version string and extension level.
Sourcepub const fn extension_level(self) -> i64
pub const fn extension_level(self) -> i64
Returns the extension level.