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
impl PageObject
Sourcepub fn is_dirty(&self) -> bool
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.
Sourcepub fn is_active(&self) -> bool
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.
Sourcepub fn content_stream(&self) -> Option<usize>
pub fn content_stream(&self) -> Option<usize>
Which /Contents element the object came from, or None for one
that was created rather than parsed.
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark the object changed, so its stream is rewritten on save.
Sourcepub fn mark_clean(&mut self)
pub fn mark_clean(&mut self)
Mark the object unchanged. The regenerator does this once a stream has been written.
Sourcepub fn set_active(&mut self, active: bool)
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.
Sourcepub fn set_content_stream(&mut self, stream: Option<usize>)
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
impl PageObject
Sourcepub fn state(&self) -> &GraphicsState
pub fn state(&self) -> &GraphicsState
The graphics state the object was created under.
Sourcepub fn marks(&self) -> &ContentMarks
pub fn marks(&self) -> &ContentMarks
The marks enclosing the object.
Trait Implementations§
Source§impl Clone for PageObject
impl Clone for PageObject
Source§fn clone(&self) -> PageObject
fn clone(&self) -> PageObject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more