Skip to main content

PageObject

Enum PageObject 

Source
pub enum PageObject {
    Path(Box<Content<PathObject>>),
    Text(Box<Content<TextObject>>),
    Image(Box<Content<ImageObject>>),
    Shading(Box<Content<ShadingObject>>),
    Form(Box<Content<FormObject>>),
}
Expand description

One thing to paint.

Deliberately not #[non_exhaustive]: a new variant must fail every match site to compile, and a downstream renderer that silently ignored a new kind of page object would silently stop drawing it.

Variants§

§

Path(Box<Content<PathObject>>)

A filled or stroked path.

§

Text(Box<Content<TextObject>>)

A run of glyphs.

§

Image(Box<Content<ImageObject>>)

An image.

§

Shading(Box<Content<ShadingObject>>)

A shading painted by sh.

§

Form(Box<Content<FormObject>>)

A form XObject’s contents.

Implementations§

Source§

impl PageObject

Source

pub fn is_dirty(&self) -> bool

Whether the object has been changed since it was parsed.

A dirty object’s content stream is rewritten on the next save; a clean one’s is left byte-for-byte alone.

Source

pub fn is_active(&self) -> bool

Whether the object is painted at all.

An inactive object stays in the list — so its index and its stream are still known — but contributes nothing to a regenerated stream, which is how it disappears from the page without being deleted.

Source

pub fn content_stream(&self) -> Option<usize>

Which /Contents element the object came from, or None for one that was created rather than parsed.

Source

pub fn mark_dirty(&mut self)

Mark the object changed, so its stream is rewritten on save.

Source

pub fn mark_clean(&mut self)

Mark the object unchanged. The regenerator does this once a stream has been written.

Source

pub fn set_active(&mut self, active: bool)

Show or hide the object.

Changing activity always dirties the object, because both directions change what the stream must contain. Setting it to the value it already has changes nothing at all — an idempotent call does not force a regeneration.

Source

pub fn set_content_stream(&mut self, stream: Option<usize>)

Set the /Contents index the object belongs to.

Used by the regenerator’s removal bookkeeping, which renumbers every object after elements are dropped from the array.

Source§

impl PageObject

Source

pub fn state(&self) -> &GraphicsState

The graphics state the object was created under.

Source

pub fn marks(&self) -> &ContentMarks

The marks enclosing the object.

Trait Implementations§

Source§

impl Clone for PageObject

Source§

fn clone(&self) -> PageObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PageObject

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PageObject

Source§

fn eq(&self, other: &PageObject) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PageObject

Auto Trait Implementations§

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.