pub struct PdfRenderer { /* private fields */ }Expand description
High-level PDF renderer
Parses a PDF document and provides page rendering capabilities.
Implementations§
Source§impl PdfRenderer
impl PdfRenderer
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Parse a PDF document from bytes
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages in the document
Sourcepub fn render_page(&self, page_index: usize, dpi: f32) -> Result<RasterPage>
pub fn render_page(&self, page_index: usize, dpi: f32) -> Result<RasterPage>
Render a single page at the given DPI
Returns a RasterPage with RGBA pixels.
Auto Trait Implementations§
impl Freeze for PdfRenderer
impl RefUnwindSafe for PdfRenderer
impl Send for PdfRenderer
impl Sync for PdfRenderer
impl Unpin for PdfRenderer
impl UnsafeUnpin for PdfRenderer
impl UnwindSafe for PdfRenderer
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> 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