pub struct FormXObject<'a> { /* private fields */ }
Expand description
Writer for an form XObject stream. PDF 1.1+.
This struct is created by Chunk::form_xobject
.
Note that these have nothing to do with forms that have fields to fill out. Rather, they are a way to encapsulate and reuse content across the file.
Implementations§
source§impl<'a> FormXObject<'a>
impl<'a> FormXObject<'a>
sourcepub fn bbox(&mut self, bbox: Rect) -> &mut Self
pub fn bbox(&mut self, bbox: Rect) -> &mut Self
Write the /BBox
attribute. Required.
This clips the form xobject to coordinates in its coordinate system.
sourcepub fn matrix(&mut self, matrix: [f32; 6]) -> &mut Self
pub fn matrix(&mut self, matrix: [f32; 6]) -> &mut Self
Write the /Matrix
attribute to map form space to user space.
sourcepub fn resources(&mut self) -> Resources<'_>
pub fn resources(&mut self) -> Resources<'_>
Start writing the /Resources
dictionary to specify the resources used
by the XObject. This makes it independent of the parent content stream
it is eventually invoked in. PDF 1.2+.
sourcepub fn group(&mut self) -> Group<'_>
pub fn group(&mut self) -> Group<'_>
Start writing the /Group
dictionary to set up transparency model
parameters and let this XObject be known as a group. PDF 1.4+.
sourcepub fn struct_parent(&mut self, key: i32) -> &mut Self
pub fn struct_parent(&mut self, key: i32) -> &mut Self
Write the /StructParent
attribute to indicate the structure tree
element this XObject belongs to. Mutually exclusive with
Self::struct_parents
. PDF 1.3+.
sourcepub fn struct_parents(&mut self, key: i32) -> &mut Self
pub fn struct_parents(&mut self, key: i32) -> &mut Self
Write the /StructParents
attribute to indicate the structure tree
elements the contents of this XObject may belong to.
Mutually exclusive with Self::struct_parent
. PDF 1.3+.
sourcepub fn reference(&mut self) -> Reference<'_>
pub fn reference(&mut self) -> Reference<'_>
Start writing the /Ref
dictionary to identify the page from an
external document that the XObject is a reference to. PDF 1.4+.
Note that this key is forbidden in PDF/A.
sourcepub fn metadata(&mut self, id: Ref) -> &mut Self
pub fn metadata(&mut self, id: Ref) -> &mut Self
Write the /Metadata
attribute to specify the XObject’s metadata. PDF
1.4+.
The reference shall point to a metadata stream.
sourcepub fn last_modified(&mut self, last_modified: Date) -> &mut Self
pub fn last_modified(&mut self, last_modified: Date) -> &mut Self
Write the /LastModified
attribute. PDF 1.3+.
sourcepub fn associated_files(&mut self) -> TypedArray<'_, FileSpec<'_>>
pub fn associated_files(&mut self) -> TypedArray<'_, FileSpec<'_>>
Start writing the /AF
array to specify the associated files of the
Form XObject. PDF 2.0+ or PDF/A-3.
Methods from Deref<Target = Stream<'a>>§
sourcepub fn decode_parms(&mut self) -> DecodeParms<'_>
pub fn decode_parms(&mut self) -> DecodeParms<'_>
Start writing the /DecodeParms
attribute.
This is a dictionary that specifies parameters to be used in decoding
the stream data using the filter specified by the
/Filter
attribute.
Methods from Deref<Target = Dict<'a>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.
sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value)
.
sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.