pub struct StructureConverter { /* private fields */ }Expand description
Converter from PDF structure elements to unified content elements.
This converter handles:
- Recursive structure element hierarchy conversion
- MCID (Marked Content ID) to content mapping
- Accessibility attribute extraction (alt text, language)
- Standard structure type mapping
Implementations§
Source§impl StructureConverter
impl StructureConverter
Sourcepub fn new(mcid_map: HashMap<u32, Vec<ContentElement>>) -> Self
pub fn new(mcid_map: HashMap<u32, Vec<ContentElement>>) -> Self
Create a new converter with an MCID to content mapping.
§Arguments
mcid_map- HashMap of MCID values to their extracted content elements
Sourcepub fn convert_struct_elem(&self, elem: &StructElem) -> Result<StructureElement>
pub fn convert_struct_elem(&self, elem: &StructElem) -> Result<StructureElement>
Convert a StructElem to a StructureElement.
This recursively converts the entire hierarchy, populating children with actual content elements where MCIDs are referenced.
§Arguments
elem- The structure element to convert
§Returns
A StructureElement with populated children
§PDF Spec Compliance
- ISO 32000-1:2008, Section 14.7.2 - Structure Hierarchy
- ISO 32000-1:2008, Section 14.7.4 - Marked Content Identification
- ISO 32000-1:2008, Section 14.9.3 - Accessibility Attributes
Auto Trait Implementations§
impl Freeze for StructureConverter
impl RefUnwindSafe for StructureConverter
impl Send for StructureConverter
impl Sync for StructureConverter
impl Unpin for StructureConverter
impl UnsafeUnpin for StructureConverter
impl UnwindSafe for StructureConverter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.