pub struct TableContent {
pub bbox: Rect,
pub rows: Vec<TableRowContent>,
pub column_widths: Vec<f32>,
pub reading_order: Option<usize>,
pub caption: Option<String>,
pub style: TableContentStyle,
pub detection_info: TableDetectionInfo,
}Expand description
Table content element.
Represents a table with rows, columns, and cells that can be extracted from or written to a PDF.
Fields§
§bbox: RectBounding box of the entire table
rows: Vec<TableRowContent>Table rows
column_widths: Vec<f32>Column widths (if known)
reading_order: Option<usize>Reading order index
caption: Option<String>Optional table caption
style: TableContentStyleTable style information
detection_info: TableDetectionInfoDetection/source information
Implementations§
Source§impl TableContent
impl TableContent
Sourcepub fn add_row(&mut self, row: TableRowContent)
pub fn add_row(&mut self, row: TableRowContent)
Add a row to the table.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of columns (based on first row).
Sourcepub fn get_cell(&self, row: usize, col: usize) -> Option<&TableCellContent>
pub fn get_cell(&self, row: usize, col: usize) -> Option<&TableCellContent>
Get a cell at the specified row and column.
Sourcepub fn has_header(&self) -> bool
pub fn has_header(&self) -> bool
Check if the table has a header row.
Sourcepub fn with_detection_info(self, info: TableDetectionInfo) -> Self
pub fn with_detection_info(self, info: TableDetectionInfo) -> Self
Set the detection info for this table.
Sourcepub fn user_generated(bbox: Rect) -> Self
pub fn user_generated(bbox: Rect) -> Self
Create a user-generated table.
Sourcepub fn is_from_structure_tree(&self) -> bool
pub fn is_from_structure_tree(&self) -> bool
Check if table came from structure tree.
Sourcepub fn detection_confidence(&self) -> f32
pub fn detection_confidence(&self) -> f32
Get detection confidence.
Trait Implementations§
Source§impl Clone for TableContent
impl Clone for TableContent
Source§impl Debug for TableContent
impl Debug for TableContent
Auto Trait Implementations§
impl Freeze for TableContent
impl RefUnwindSafe for TableContent
impl Send for TableContent
impl Sync for TableContent
impl Unpin for TableContent
impl UnsafeUnpin for TableContent
impl UnwindSafe for TableContent
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