pub struct Attributes<'a> { /* private fields */ }
Expand description
Writer for an attribute dictionary. PDF 1.4+
This struct must set the /O
attribute by calling any of the methods. This
struct is created by ClassMap::single
. An array of this struct is
created by StructElement::attributes
and ClassMap::multiple
.
Implementations§
source§impl<'a> Attributes<'a>
impl<'a> Attributes<'a>
sourcepub fn owner(&mut self, owner: AttributeOwner) -> &mut Self
pub fn owner(&mut self, owner: AttributeOwner) -> &mut Self
Write the /O
attribute to set the owner.
Should not be called when using any of the other methods.
sourcepub fn user(&mut self) -> TypedArray<'_, UserProperty<'_>>
pub fn user(&mut self) -> TypedArray<'_, UserProperty<'_>>
Set the /O
attribute to user-defined and start writing the /P
array
with user properties. PDF 1.6+
sourcepub fn layout(self) -> LayoutAttributes<'a>
pub fn layout(self) -> LayoutAttributes<'a>
Set the /O
attribute to Layout
to start writing layout parameters.
sourcepub fn list(self) -> ListAttributes<'a>
pub fn list(self) -> ListAttributes<'a>
Set the /O
attribute to List
to start writing list attributes.
sourcepub fn field(self) -> FieldAttributes<'a>
pub fn field(self) -> FieldAttributes<'a>
Set the /O
attribute to PrintField
to start writing attributes for
the appearance of form fields. PDF 1.6+
sourcepub fn table(self) -> TableAttributes<'a>
pub fn table(self) -> TableAttributes<'a>
Set the /O
attribute to Table
to start writing table attributes.
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.