pub struct PdfDoc { /* private fields */ }
Implementations§
Source§impl PdfDoc
impl PdfDoc
Sourcepub fn load(pdf: &[u8]) -> Result<Self, PdfThumbError>
pub fn load(pdf: &[u8]) -> Result<Self, PdfThumbError>
Load a PDF document from memory.
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, PdfThumbError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, PdfThumbError>
Open a PDF document from a path.
Sourcepub async fn open_async<P: AsRef<Path>>(path: P) -> Result<Self, PdfThumbError>
pub async fn open_async<P: AsRef<Path>>(path: P) -> Result<Self, PdfThumbError>
Open a PDF document from a path asynchronously.
Sourcepub fn page_count(&self) -> Result<u32, PdfThumbError>
pub fn page_count(&self) -> Result<u32, PdfThumbError>
Get the number of PDF document.
Sourcepub fn thumb(&self) -> Result<Vec<u8>, PdfThumbError>
pub fn thumb(&self) -> Result<Vec<u8>, PdfThumbError>
Generate a thumbnail image with default options.
Sourcepub async fn thumb_async(&self) -> Result<Vec<u8>, PdfThumbError>
pub async fn thumb_async(&self) -> Result<Vec<u8>, PdfThumbError>
Generate a thumbnail image with default options asynchronously.
Sourcepub fn thumb_with_options(
&self,
options: Options,
) -> Result<Vec<u8>, PdfThumbError>
pub fn thumb_with_options( &self, options: Options, ) -> Result<Vec<u8>, PdfThumbError>
Generate a thumbnail image with the specified options.
Sourcepub async fn thumb_with_options_async(
&self,
options: Options,
) -> Result<Vec<u8>, PdfThumbError>
pub async fn thumb_with_options_async( &self, options: Options, ) -> Result<Vec<u8>, PdfThumbError>
Generate a thumbnail image with the specified options asynchronously.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfDoc
impl RefUnwindSafe for PdfDoc
impl Send for PdfDoc
impl Sync for PdfDoc
impl Unpin for PdfDoc
impl UnwindSafe for PdfDoc
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