pub struct Document {
pub common_data: Option<String>,
pub pages: Vec<PageRef>,
pub outlines: Option<String>,
pub permissions: Option<String>,
pub actions: Option<String>,
pub v_preferences: Option<String>,
pub bookmarks: Option<String>,
pub annotations: Option<ST_Loc>,
pub custom_tags: Option<ST_Loc>,
pub attachments: Option<ST_Loc>,
pub extensions: Option<ST_Loc>,
}Expand description
文档根节点。
Document.xml 文档根节点,定义了文档的页面、资源、权限等信息。
对应 Java: org.ofdrw.core.basicStructure.doc.Document
Fields§
§common_data: Option<String>文档公共数据引用。
pages: Vec<PageRef>页树引用。
outlines: Option<String>大纲引用。
permissions: Option<String>权限声明。
actions: Option<String>动作序列。
v_preferences: Option<String>视图首选项。
bookmarks: Option<String>书签集。
annotations: Option<ST_Loc>注释列表路径。
自定义标引列表路径。
attachments: Option<ST_Loc>附件列表路径。
extensions: Option<ST_Loc>扩展列表路径。
Implementations§
Source§impl Document
impl Document
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
获取页面数量。
Sourcepub fn annotations(self, path: ST_Loc) -> Self
pub fn annotations(self, path: ST_Loc) -> Self
设置注释路径。
Sourcepub fn attachments(self, path: ST_Loc) -> Self
pub fn attachments(self, path: ST_Loc) -> Self
设置附件路径。
Sourcepub fn extensions(self, path: ST_Loc) -> Self
pub fn extensions(self, path: ST_Loc) -> Self
设置扩展路径。
Trait Implementations§
impl StructuralPartialEq for Document
Source§impl XmlElement for Document
impl XmlElement for Document
Source§fn element_name(&self) -> &'static str
fn element_name(&self) -> &'static str
对应 Java: org.ofdrw.core.basicStructure.doc.Document
Source§fn child_nodes(&self) -> Vec<XmlNode>
fn child_nodes(&self) -> Vec<XmlNode>
子元素(作为
XmlNode 提供,便于嵌套序列化)。Source§fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
fn from_xml(node: &XmlNode) -> Result<Self, XmlElementError>
从节点树解析(对应 ofdrw 解析侧;quick-xml 产物)。 Read more
Source§fn text_content(&self) -> Option<&str>
fn text_content(&self) -> Option<&str>
文本内容(简单文本元素)。
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more