Struct pdfium_render::page::PdfPage
source · [−]pub struct PdfPage<'a> { /* private fields */ }Expand description
A single page in a PdfDocument.
Implementations
sourceimpl<'a> PdfPage<'a>
impl<'a> PdfPage<'a>
sourcepub fn index(&self) -> PdfPageIndex
pub fn index(&self) -> PdfPageIndex
Returns the zero-based page index of this PdfPage in its containing PdfDocument.
sourcepub fn width(&self) -> PdfPoints
pub fn width(&self) -> PdfPoints
Returns the width of this PdfPage in device-independent points. One point is 1/72 inches, roughly 0.358 mm.
sourcepub fn height(&self) -> PdfPoints
pub fn height(&self) -> PdfPoints
Returns the height of this PdfPage in device-independent points. One point is 1/72 inches, roughly 0.358 mm.
sourcepub fn orientation(&self) -> PdfPageOrientation
pub fn orientation(&self) -> PdfPageOrientation
Returns PdfPageOrientation::Landscape if the width of this PdfPage is greater than its height; otherwise returns PdfPageOrientation::Portrait.
sourcepub fn is_portrait(&self) -> bool
pub fn is_portrait(&self) -> bool
Returns true if this PdfPage has orientation PdfPageOrientation::Portrait.
sourcepub fn is_landscape(&self) -> bool
pub fn is_landscape(&self) -> bool
Returns true if this PdfPage has orientation PdfPageOrientation::Landscape.
sourcepub fn rotation(&self) -> Result<PdfBitmapRotation, PdfiumError>
pub fn rotation(&self) -> Result<PdfBitmapRotation, PdfiumError>
Returns any intrinsic rotation encoded into this document indicating a rotation should be applied to this PdfPage during rendering.
sourcepub fn set_rotation(&mut self, rotation: PdfBitmapRotation)
pub fn set_rotation(&mut self, rotation: PdfBitmapRotation)
Sets the intrinsic rotation that should be applied to this PdfPage during rendering.
sourcepub fn has_transparency(&self) -> bool
pub fn has_transparency(&self) -> bool
Returns true if any object on the page contains transparency.
sourcepub fn boundaries(&self) -> PdfPageBoundaries<'_>
pub fn boundaries(&self) -> PdfPageBoundaries<'_>
Returns the collection of bounding boxes defining the extents of this PdfPage.
sourcepub fn paper_size(&self) -> PdfPagePaperSize
pub fn paper_size(&self) -> PdfPagePaperSize
Returns the paper size of this PdfPage.
sourcepub fn text(&self) -> Result<PdfPageText<'_>, PdfiumError>
pub fn text(&self) -> Result<PdfPageText<'_>, PdfiumError>
Returns the collection of text boxes contained within this PdfPage.
sourcepub fn objects(&self) -> PdfPageObjects<'_>
pub fn objects(&self) -> PdfPageObjects<'_>
Returns the collection of page objects contained within this PdfPage.
sourcepub fn get_bitmap_with_config(
&self,
config: &PdfBitmapConfig
) -> Result<PdfBitmap<'_>, PdfiumError>
pub fn get_bitmap_with_config(
&self,
config: &PdfBitmapConfig
) -> Result<PdfBitmap<'_>, PdfiumError>
Returns a PdfBitmap using pixel dimensions, rotation settings, and rendering options configured in the given PdfBitmapConfig.
See also PdfPage::get_bitmap(), which directly creates a PdfBitmap object from this page using caller-specified pixel dimensions and page rotation settings.
sourcepub fn get_bitmap(
&self,
width: u16,
height: u16,
rotation: Option<PdfBitmapRotation>
) -> Result<PdfBitmap<'_>, PdfiumError>
pub fn get_bitmap(
&self,
width: u16,
height: u16,
rotation: Option<PdfBitmapRotation>
) -> Result<PdfBitmap<'_>, PdfiumError>
Returns a PdfBitmap with the given pixel dimensions and render-time rotation for this PdfPage containing the rendered content of this PdfPage.
It is the responsibility of the caller to ensure the given pixel width and height correctly maintain the page’s aspect ratio.
See also PdfPage::get_bitmap_with_config(), which calculates the correct pixel dimensions, rotation settings, and rendering options to apply from a PdfBitmapConfig object.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfPage<'a>
impl<'a> !Send for PdfPage<'a>
impl<'a> !Sync for PdfPage<'a>
impl<'a> Unpin for PdfPage<'a>
impl<'a> !UnwindSafe for PdfPage<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more