Skip to main content

Page

Struct Page 

Source
pub struct Page { /* private fields */ }
Expand description

Represents a single PDF page.

Implementations§

Source§

impl Page

Source

pub fn id(&self) -> ObjectId

Get the object ID of this page.

Source

pub fn page_num(&self) -> u32

Get the 1-based page number.

Source

pub fn dict(&self) -> &PdfObject

Get the raw page dictionary.

Source

pub fn media_box(&self) -> Rect

Get the media box (required for all pages).

Source

pub fn crop_box(&self) -> Rect

Get the crop box (defaults to media box).

Source

pub fn bleed_box(&self) -> Rect

Get the bleed box (defaults to crop box).

Source

pub fn trim_box(&self) -> Rect

Get the trim box (defaults to crop box).

Source

pub fn art_box(&self) -> Rect

Get the art box (defaults to crop box).

Source

pub fn rotation(&self) -> Rotation

Get the page rotation.

Source

pub fn width(&self) -> f64

Get the effective page width (accounting for rotation and crop box).

Source

pub fn height(&self) -> f64

Get the effective page height (accounting for rotation and crop box).

Source

pub fn num_annots(&self) -> usize

Get the number of annotations on this page.

Source

pub fn default_matrix(&self) -> Matrix2D

Get the default transformation matrix for this page.

Maps from default PDF coordinates (origin at bottom-left) to the page’s crop box, accounting for rotation.

Source

pub fn resources(&self) -> Option<&PdfObject>

Get the resource dictionary for this page.

Source

pub fn contents(&self) -> Option<&PdfObject>

Get the content stream reference(s) for this page.

Source

pub fn user_unit(&self) -> f64

Get the UserUnit value (default 1.0 = 1/72 inch).

Trait Implementations§

Source§

impl Clone for Page

Source§

fn clone(&self) -> Page

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Page

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Page

§

impl RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnsafeUnpin for Page

§

impl UnwindSafe for Page

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.