pub struct TextExtractor { /* private fields */ }Expand description
Text extractor for PDF pages with CMap support
Implementations§
Source§impl TextExtractor
impl TextExtractor
Sourcepub fn with_options(options: ExtractionOptions) -> Self
pub fn with_options(options: ExtractionOptions) -> Self
Create a text extractor with custom options
Sourcepub fn merge_fragments_for_partition(
&self,
fragments: &[TextFragment],
) -> Vec<TextFragment>
pub fn merge_fragments_for_partition( &self, fragments: &[TextFragment], ) -> Vec<TextFragment>
Run the full fragment-merge chain used by the partition pipeline: kerning fix → line reconstruction → paragraph reconstruction.
Honors ExtractionOptions::reconstruct_paragraphs: when false, only
merge_close_fragments (the kerning fix) runs and the input is
returned at fragment granularity.
This method is pub so the integration test in
tests/paragraph_reconstruction_test.rs can exercise it without going
through a PDF file. Production callers should prefer
PdfDocument::partition() and friends, which use this internally.
Sourcepub fn extract_from_document<R: Read + Seek>(
&mut self,
document: &PdfDocument<R>,
) -> ParseResult<Vec<ExtractedText>>
pub fn extract_from_document<R: Read + Seek>( &mut self, document: &PdfDocument<R>, ) -> ParseResult<Vec<ExtractedText>>
Extract text from a PDF document
Sourcepub fn extract_from_page<R: Read + Seek>(
&mut self,
document: &PdfDocument<R>,
page_index: u32,
) -> ParseResult<ExtractedText>
pub fn extract_from_page<R: Read + Seek>( &mut self, document: &PdfDocument<R>, page_index: u32, ) -> ParseResult<ExtractedText>
Extract text from a specific page
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextExtractor
impl RefUnwindSafe for TextExtractor
impl Send for TextExtractor
impl Sync for TextExtractor
impl Unpin for TextExtractor
impl UnsafeUnpin for TextExtractor
impl UnwindSafe for TextExtractor
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