pub struct Namespace<'a> { /* private fields */ }Expand description
Writer for a namespace dictionary. PDF 2.0+
This struct is created by Chunk::namespace.
Implementations§
Source§impl Namespace<'_>
impl Namespace<'_>
Sourcepub fn ns(&mut self, identifier: TextStr<'_>) -> &mut Self
pub fn ns(&mut self, identifier: TextStr<'_>) -> &mut Self
Write the /NS attribute to specify the identifier (URI) of the namespace.
Sourcepub fn schema(&mut self) -> FileSpec<'_>
pub fn schema(&mut self) -> FileSpec<'_>
Start writing the /Schema attribute to point to a schema definition
for the namespace. Optional.
Sourcepub fn role_map_ns(&mut self) -> NamespaceRoleMap<'_>
pub fn role_map_ns(&mut self) -> NamespaceRoleMap<'_>
Start writing the /RoleMapNS attribute to map structure elements to
elements in another namespace. Optional.
For a mechanism to define role mappings compatible with PDF 1.3 and
above, see StructTreeRoot::role_map.
Sourcepub fn pdf_2_ns(self)
pub fn pdf_2_ns(self)
Write the namespace dictionary for the standard structure namespace for PDF 2.0.
Sourcepub fn pdf_1_7_ns(self)
pub fn pdf_1_7_ns(self)
Write the namespace dictionary for the standard structure namespace for PDF 1.7.
Sourcepub fn mathml_3_0_ns(self)
pub fn mathml_3_0_ns(self)
Write the namespace dictionary for MathML 3.0.
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.