pub struct OfdReader { /* private fields */ }Expand description
An OFD document reader.
Implementations§
Source§impl OfdReader
impl OfdReader
Sourcepub fn open(path: impl AsRef<Path>) -> OfdResult<Self>
pub fn open(path: impl AsRef<Path>) -> OfdResult<Self>
Open and parse an OFD file from a path.
§Errors
Returns an error if the file cannot be read or contains invalid OFD data.
Sourcepub fn open_with_options(
path: impl AsRef<Path>,
options: ReadOptions,
) -> OfdResult<Self>
pub fn open_with_options( path: impl AsRef<Path>, options: ReadOptions, ) -> OfdResult<Self>
Sourcepub fn from_bytes(data: &[u8]) -> OfdResult<Self>
pub fn from_bytes(data: &[u8]) -> OfdResult<Self>
Sourcepub fn visit_path(
path: impl AsRef<Path>,
options: ReadOptions,
visitor: impl FnMut(usize, OfdPage) -> OfdResult<()>,
) -> OfdResult<usize>
pub fn visit_path( path: impl AsRef<Path>, options: ReadOptions, visitor: impl FnMut(usize, OfdPage) -> OfdResult<()>, ) -> OfdResult<usize>
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages in the document.
Sourcepub fn extract_text(&self) -> Vec<String>
pub fn extract_text(&self) -> Vec<String>
Extract text from all pages, one String per page.
Sourcepub fn extract_all_text(&self) -> String
pub fn extract_all_text(&self) -> String
Extract all text joined into a single string with page separators.
Auto Trait Implementations§
impl Freeze for OfdReader
impl RefUnwindSafe for OfdReader
impl Send for OfdReader
impl Sync for OfdReader
impl Unpin for OfdReader
impl UnsafeUnpin for OfdReader
impl UnwindSafe for OfdReader
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