Struct printpdf::PdfResources
source · pub struct PdfResources {
pub xobjects: XObjectList,
pub patterns: PatternList,
pub graphics_states: ExtendedGraphicsStateList,
pub layers: OCGList,
pub link_annotations: LinkAnnotationList,
}
Expand description
Struct for storing the PDF Resources, to be used on a PDF page
Fields§
§xobjects: XObjectList
External graphics objects
patterns: PatternList
Patterns used on this page. Do not yet, use, placeholder.
graphics_states: ExtendedGraphicsStateList
Graphics states used on this page
layers: OCGList
Layers / optional content (“Properties”) in the resource dictionary
link_annotations: LinkAnnotationList
Link Annotations used in this page
Implementations§
source§impl PdfResources
impl PdfResources
sourcepub fn add_graphics_state(
&mut self,
added_state: ExtendedGraphicsState
) -> ExtendedGraphicsStateRef
pub fn add_graphics_state( &mut self, added_state: ExtendedGraphicsState ) -> ExtendedGraphicsStateRef
Add a graphics state to the resources
sourcepub fn add_xobject(&mut self, xobj: XObject) -> XObjectRef
pub fn add_xobject(&mut self, xobj: XObject) -> XObjectRef
Adds an XObject to the page
sourcepub fn add_pattern(&mut self, pattern: Pattern) -> PatternRef
pub fn add_pattern(&mut self, pattern: Pattern) -> PatternRef
STUB: Adds a pattern to the resources, to be used like a color
sourcepub fn add_link_annotation(
&mut self,
link_annotation: LinkAnnotation
) -> LinkAnnotationRef
pub fn add_link_annotation( &mut self, link_annotation: LinkAnnotation ) -> LinkAnnotationRef
STUB: Adds a link annotation to the resources
sourcepub fn into_with_document_and_layers(
self,
doc: &mut Document,
layers: Vec<Object>
) -> (Dictionary, Vec<OCGRef>)
pub fn into_with_document_and_layers( self, doc: &mut Document, layers: Vec<Object> ) -> (Dictionary, Vec<OCGRef>)
See XObject::Into_with_document
.
The resources also need access to the layers (the optional content groups), this should be a
Vec<lopdf::Object::Reference>
(to the actual OCG groups, which are added on the document level)
Trait Implementations§
source§impl Clone for PdfResources
impl Clone for PdfResources
source§fn clone(&self) -> PdfResources
fn clone(&self) -> PdfResources
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PdfResources
impl Debug for PdfResources
source§impl Default for PdfResources
impl Default for PdfResources
source§fn default() -> PdfResources
fn default() -> PdfResources
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for PdfResources
impl Send for PdfResources
impl Sync for PdfResources
impl Unpin for PdfResources
impl UnwindSafe for PdfResources
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