From 9a25d60d832478784cf5c6d6e0e9fac312bf5c3e Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:23:14 +0100 Subject: [PATCH] Add ID element to struct elem (#45) --- src/structure.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/structure.rs b/src/structure.rs index bcf939a..900cb6d 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -413,6 +413,13 @@ impl<'a> StructElement<'a> { self } + /// Write the `/ID` attribute to specify the element identifier of this + /// structure element. + pub fn id(&mut self, id: Str) -> &mut Self { + self.dict.pair(Name(b"ID"), id); + self + } + /// Write the `/Pg` attribute to specify the page some or all of this /// structure element is located on. pub fn page(&mut self, page: Ref) -> &mut Self {