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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LineBreakMode
impl Debug for LineBreakMode
Source§impl Hash for LineBreakMode
impl Hash for LineBreakMode
Source§impl PartialEq for LineBreakMode
impl PartialEq for LineBreakMode
impl Copy for LineBreakMode
impl Eq for LineBreakMode
impl StructuralPartialEq for LineBreakMode
Auto Trait Implementations§
impl Freeze for LineBreakMode
impl RefUnwindSafe for LineBreakMode
impl Send for LineBreakMode
impl Sync for LineBreakMode
impl Unpin for LineBreakMode
impl UnwindSafe for LineBreakMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more