pub enum LineBreakMode {
Auto,
PreserveAll,
Normalize,
}Expand description
Line break handling mode
Controls how line breaks in the PDF are interpreted. PDFs often include line breaks for layout purposes that should be removed when extracting continuous text (e.g., hyphenated words at line ends).
§Examples
use oxidize_pdf::text::plaintext::LineBreakMode;
let mode = LineBreakMode::Auto; // Detect based on context
let mode = LineBreakMode::PreserveAll; // Keep all line breaks
let mode = LineBreakMode::Normalize; // Join hyphenated wordsVariants§
Auto
Automatically detect line breaks
Uses heuristics to determine if a line break is semantic (paragraph end) or just for layout (line wrap). Joins lines that appear to be wrapped.
Best for: General-purpose text extraction
PreserveAll
Preserve all line breaks from PDF
Every line break in the PDF becomes a newline in the output. Useful when the PDF’s line breaks are semantically meaningful.
Best for: Poetry, code listings, formatted text
Normalize
Normalize line breaks (join hyphenated words)
Detects hyphenated words at line ends (e.g., “docu-\nment”) and joins them into single words (“document”). Other line breaks are preserved.
Best for: Continuous text extraction from books, articles
Trait Implementations§
Source§impl Clone for LineBreakMode
impl Clone for LineBreakMode
Source§fn clone(&self) -> LineBreakMode
fn clone(&self) -> LineBreakMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more