pub struct StructElement<'a> { /* private fields */ }
Expand description
Writer for a structure element dictionary. PDF 1.3+
Implementations§
source§impl<'a> StructElement<'a>
impl<'a> StructElement<'a>
sourcepub fn kind(&mut self, role: StructRole) -> &mut Self
pub fn kind(&mut self, role: StructRole) -> &mut Self
Write the /S
attribute to specify the role of this structure element.
Required if no custom type is specified with Self::custom_kind
.
sourcepub fn custom_kind(&mut self, name: Name<'_>) -> &mut Self
pub fn custom_kind(&mut self, name: Name<'_>) -> &mut Self
Write the /S
attribute to specify the role of this structure element
as a custom name. Required if no standard type is specified with
Self::kind
.
In some PDF/A profiles like PDF/A-2a, custom kinds must be mapped to their closest standard type in the role map.
sourcepub fn parent(&mut self, parent: Ref) -> &mut Self
pub fn parent(&mut self, parent: Ref) -> &mut Self
Write the /P
attribute to specify the parent of this structure
element. Required.
sourcepub fn page(&mut self, page: Ref) -> &mut Self
pub fn page(&mut self, page: Ref) -> &mut Self
Write the /Pg
attribute to specify the page some or all of this
structure element is located on.
sourcepub fn child(&mut self, id: Ref) -> &mut Self
pub fn child(&mut self, id: Ref) -> &mut Self
Write the /K
attribute to reference the immediate child of this
element.
sourcepub fn marked_content_child(&mut self) -> MarkedRef<'_>
pub fn marked_content_child(&mut self) -> MarkedRef<'_>
Start writing the /K
attribute to reference the immediate marked
content child of this element.
sourcepub fn object_child(&mut self) -> ObjectRef<'_>
pub fn object_child(&mut self) -> ObjectRef<'_>
Start writing the /K
attribute to reference the immediate object child
of this element.
sourcepub fn children(&mut self) -> StructChildren<'_>
pub fn children(&mut self) -> StructChildren<'_>
Start writing the /K
attribute to specify the children elements and
associated marked content sequences.
sourcepub fn attributes(&mut self) -> TypedArray<'_, Attributes<'_>>
pub fn attributes(&mut self) -> TypedArray<'_, Attributes<'_>>
Start writing the /A
attribute to specify the attributes of this
structure element.
sourcepub fn attribute_class(&mut self) -> TypedArray<'_, Name<'_>>
pub fn attribute_class(&mut self) -> TypedArray<'_, Name<'_>>
Start writing the /C
attribute to associate the structure element with
an attribute class.
sourcepub fn revision(&mut self, revision: i32) -> &mut Self
pub fn revision(&mut self, revision: i32) -> &mut Self
Write the /R
attribute to specify the revision number, starting at 0.
sourcepub fn title(&mut self, title: TextStr<'_>) -> &mut Self
pub fn title(&mut self, title: TextStr<'_>) -> &mut Self
Write the /T
attribute to set a title.
sourcepub fn lang(&mut self, lang: TextStr<'_>) -> &mut Self
pub fn lang(&mut self, lang: TextStr<'_>) -> &mut Self
Write the /Lang
attribute to set a language. PDF 1.4+
sourcepub fn alt(&mut self, alt: TextStr<'_>) -> &mut Self
pub fn alt(&mut self, alt: TextStr<'_>) -> &mut Self
Write the /Alt
attribute to provide a description of the structure
element.
sourcepub fn expanded(&mut self, expanded: TextStr<'_>) -> &mut Self
pub fn expanded(&mut self, expanded: TextStr<'_>) -> &mut Self
Write the /E
attribute to set the expanded form of the abbreviation
in this structure element. PDF 1.5+
sourcepub fn actual_text(&mut self, actual_text: TextStr<'_>) -> &mut Self
pub fn actual_text(&mut self, actual_text: TextStr<'_>) -> &mut Self
Write the /ActualText
attribute to set the exact text replacement. PDF
1.4+
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
element. PDF 2.0+ or PDF/A-3.
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.