pub enum ContentElement {
Text(TextContent),
Image(ImageContent),
Path(PathContent),
Structure(StructureElement),
Table(TableContent),
}Expand description
A content element that can be extracted from or written to a PDF.
This is the unified intermediate representation used by both the read pipeline (PDF → ContentElement) and write pipeline (ContentElement → PDF).
Variants§
Text(TextContent)
Text content with positioning and styling
Image(ImageContent)
Image content with position and format information
Path(PathContent)
Vector path/graphics content
Structure(StructureElement)
Structural element (for Tagged PDF support)
Table(TableContent)
Table content with rows and cells
Implementations§
Source§impl ContentElement
impl ContentElement
Sourcepub fn reading_order(&self) -> Option<usize>
pub fn reading_order(&self) -> Option<usize>
Get the reading order of this element, if assigned.
Sourcepub fn as_text(&self) -> Option<&TextContent>
pub fn as_text(&self) -> Option<&TextContent>
Get as text content if this is a text element.
Sourcepub fn as_image(&self) -> Option<&ImageContent>
pub fn as_image(&self) -> Option<&ImageContent>
Get as image content if this is an image element.
Sourcepub fn as_path(&self) -> Option<&PathContent>
pub fn as_path(&self) -> Option<&PathContent>
Get as path content if this is a path element.
Sourcepub fn as_table(&self) -> Option<&TableContent>
pub fn as_table(&self) -> Option<&TableContent>
Get as table content if this is a table element.
Trait Implementations§
Source§impl Clone for ContentElement
impl Clone for ContentElement
Auto Trait Implementations§
impl Freeze for ContentElement
impl RefUnwindSafe for ContentElement
impl Send for ContentElement
impl Sync for ContentElement
impl Unpin for ContentElement
impl UnsafeUnpin for ContentElement
impl UnwindSafe for ContentElement
Blanket Implementations§
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