kakemono 0.24.0

Convert PDF, Word, Excel, PowerPoint and EPUB documents and web pages to HTML, Markdown, EPUB, LaTeX and JSON in Rust
Documentation
//! Options and tuning parameters of the analysis. The config struct of each
//! analysis stage is re-exported here: [`LayoutConfig`] holds one of each.
//! [`ExcelConfig`] holds the thresholds of the reading of a workbook,
//! [`WorkbookPdfConfig`] those of its layout in pages.

pub use crate::analysis::blocks::BlocksConfig;
pub use crate::analysis::floats::FloatsConfig;
pub use crate::analysis::furniture::FurnitureConfig;
pub use crate::analysis::lines::LinesConfig;
pub use crate::analysis::math::MathConfig;
pub use crate::analysis::order::OrderConfig;
pub use crate::analysis::page::PageConfig;
pub use crate::analysis::semantics::SemanticsConfig;
pub use crate::analysis::tables::TablesConfig;
pub use crate::excel::ExcelConfig;
pub use crate::layout::workbook::{WorkbookPdfConfig, WorkbookPdfStyle};

/// Options of the analysis.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AnalyzeOptions {
    /// Reconstruct the row/column structure of tables.
    pub tables: bool,
    /// Worker threads for reading the pages and building their lines (0 =
    /// one per CPU).
    pub jobs: usize,
    /// Thresholds of the analysis stages.
    pub layout: LayoutConfig,
}

impl Default for AnalyzeOptions {
    fn default() -> Self {
        Self {
            tables: true,
            jobs: 0,
            layout: LayoutConfig::default(),
        }
    }
}

/// Every threshold of the analysis, grouped by stage. The defaults are the
/// values the analysis is tuned for; each field is documented where its
/// struct is defined.
#[derive(Debug, Clone, Copy, PartialEq, Default)]
pub struct LayoutConfig {
    /// Document-wide statistics of the pages.
    pub page: PageConfig,
    /// Grouping glyphs into lines.
    pub lines: LinesConfig,
    /// Removal of running heads, page numbers and margin stamps.
    pub furniture: FurnitureConfig,
    /// Detection of figures, tables and their captions.
    pub floats: FloatsConfig,
    /// Reconstruction of table grids.
    pub tables: TablesConfig,
    /// Reading order.
    pub order: OrderConfig,
    /// Grouping lines into blocks.
    pub blocks: BlocksConfig,
    /// Classification, paragraph merging and assembly of the document.
    pub semantics: SemanticsConfig,
    /// Rebuilding the structure of displayed formulas.
    pub math: MathConfig,
}