pub struct PdfExtractor { /* private fields */ }Expand description
PDF document content extractor
Implementations§
Source§impl PdfExtractor
impl PdfExtractor
Sourcepub fn new(config: ExtractorConfig) -> Self
pub fn new(config: ExtractorConfig) -> Self
Create a new PDF extractor with the given configuration
Sourcepub fn extract_from_file(&self, path: &Path) -> Result<ExtractResult>
pub fn extract_from_file(&self, path: &Path) -> Result<ExtractResult>
Extract text from a PDF file path
Sourcepub fn extract_from_bytes(
&self,
bytes: &[u8],
source: String,
) -> Result<ExtractResult>
pub fn extract_from_bytes( &self, bytes: &[u8], source: String, ) -> Result<ExtractResult>
Extract text from PDF bytes
Trait Implementations§
Source§impl Default for PdfExtractor
impl Default for PdfExtractor
Source§impl Extractor for PdfExtractor
impl Extractor for PdfExtractor
Source§fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract text from a PDF source (file path or URL)
Source§fn extract_sanitized<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract_sanitized<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract and sanitize content
Auto Trait Implementations§
impl Freeze for PdfExtractor
impl RefUnwindSafe for PdfExtractor
impl Send for PdfExtractor
impl Sync for PdfExtractor
impl Unpin for PdfExtractor
impl UnsafeUnpin for PdfExtractor
impl UnwindSafe for PdfExtractor
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
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>
Converts
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>
Converts
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