pub struct StructElement<'a> { /* private fields */ }
Expand description
Writer for a structure element dictionary. PDF 1.3+
Implementations§
Source§impl StructElement<'_>
impl StructElement<'_>
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 id(&mut self, id: Str<'_>) -> &mut Self
pub fn id(&mut self, id: Str<'_>) -> &mut Self
Write the /ID
attribute to specify the element identifier of this
structure element.
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.