pub struct OfdMetadata {Show 35 fields
pub version: String,
pub doc_id: Option<String>,
pub title: Option<String>,
pub author: Option<String>,
pub creator: Option<String>,
pub creator_version: Option<String>,
pub creation_date: Option<NaiveDateTime>,
pub creation_date_raw: Option<String>,
pub mod_date: Option<NaiveDateTime>,
pub mod_date_raw: Option<String>,
pub max_unit_id: u32,
pub bookmarks: Option<Bookmarks>,
pub outlines: Option<Bookmarks>,
pub custom_datas: Option<CustomDatas>,
pub doc_usage: Option<String>,
pub keywords: Option<String>,
pub subject: Option<String>,
pub application_box: Option<String>,
pub content_box: Option<String>,
pub clip_box: Option<String>,
pub bleed_box: Option<String>,
pub trim_box: Option<String>,
pub signatures_path: Option<String>,
pub template_pages: Vec<TemplatePage>,
pub annotations_path: Option<String>,
pub attachments_path: Option<String>,
pub custom_tags_path: Option<String>,
pub page_area_present: bool,
pub doc_dir: String,
pub document_file: String,
pub document_res: Option<String>,
pub document_res_element_present: bool,
pub public_res_present: bool,
pub public_res_element_present: bool,
pub permissions: Option<Permissions>,
}Expand description
OFD 文档元数据(OFD.xml 层级)。
对应 Java: ofdrw CT_DocInfo。
Fields§
§version: String文档版本(默认: “1.0”)。
doc_id: Option<String>文档标识符(ofd:DocID)。
title: Option<String>文档标题。
文档作者(ofd:Author)。
creator: Option<String>创建应用程序名称(ofd:Creator)。
creator_version: Option<String>创建应用程序版本(ofd:CreatorVersion)。
creation_date: Option<NaiveDateTime>创建日期(ofd:CreationDate)。
creation_date_raw: Option<String>创建日期原始文本(ofd:CreationDate),roundtrip 保真用。
保留 OFD 文件中 <ofd:CreationDate> 的原始字符串(如 "2020-01-25"),
writer 优先使用此值原样输出,避免强加日期格式(如追加 T00:00:00)。
mod_date: Option<NaiveDateTime>最后修改日期(ofd:ModDate)。
mod_date_raw: Option<String>最后修改日期原始文本(ofd:ModDate),roundtrip 保真用。
保留 OFD 文件中 <ofd:ModDate> 的原始字符串,writer 优先使用此值原样输出。
max_unit_id: u32最大单元标识符(ofd:MaxUnitID),默认 0。
bookmarks: Option<Bookmarks>书签集合(ofd:Bookmarks)。
outlines: Option<Bookmarks>大纲集合(ofd:Outlines,即 GB/T 33190-2016 的书签大纲)。
custom_datas: Option<CustomDatas>自定义数据集合(ofd:CustomDatas)。
doc_usage: Option<String>文档用途(ofd:DocUsage),如 “Normal”。
keywords: Option<String>文档关键词(ofd:Keywords)。
subject: Option<String>文档主题(ofd:Subject),对应 ofdrw CT_DocInfo.Subject。
application_box: Option<String>应用区域(ofd:ApplicationBox),格式 “x y w h”。
content_box: Option<String>内容区域(ofd:ContentBox),格式 “x y w h”。
clip_box: Option<String>裁剪区域(ofd:ClipBox),格式 “x y w h”。
bleed_box: Option<String>出血区域(ofd:BleedBox),格式 “x y w h”。
trim_box: Option<String>裁切区域(ofd:TrimBox),格式 “x y w h”。
signatures_path: Option<String>签名容器路径(ofd:Signatures),位于 OFD.xml 的 DocBody 中,如 “/Doc_0/Signs/Signatures.xml”。
template_pages: Vec<TemplatePage>模板页引用(ofd:TemplatePage),位于 Document.xml 的 CommonData 中。
annotations_path: Option<String>注释容器路径(ofd:Annotations),位于 Document.xml 中,如 “Annots/Annotations.xml”。
attachments_path: Option<String>附件容器路径(ofd:Attachments),位于 Document.xml 中,如 “Attachs/Attachments.xml”。
自定义标签容器路径(ofd:CustomTags),位于 Document.xml 中,如 “Tags/CustomTags.xml”。
page_area_present: bool原始 Document.xml 是否声明了 ofd:PageArea(ofdrw 未显式设置页面大小时省略该元素)。
doc_dir: String文档目录(ZIP 中的目录前缀,如 “Doc_0”)。
document_file: StringDocument XML 文件名(位于 doc_dir 下,通常为 “Document.xml”,
非标准文件可能是 “Document_0.xml”)。
document_res: Option<String>DocumentRes 引用(CommonData 中 <ofd:DocumentRes> 的文本,如
“DocumentRes.xml” 或非标准的 “DocumentRes_0.xml”)。
document_res_element_present: boolCommonData 是否声明了 ofd:DocumentRes 元素(ofdrw 样本可能把 PublicRes 引用错误指向 DocumentRes.xml 而无 DocumentRes 元素)。
public_res_present: bool源文档是否包含 PublicRes.xml(ofdrw 在无字体资源时不写出该文件, 但 Document.xml 中的引用仍保留)。
public_res_element_present: boolDocument.xml 的 CommonData 是否声明了 ofd:PublicRes 引用。
permissions: Option<Permissions>文档权限(ofd:Permissions),如存在。
Trait Implementations§
Source§impl Clone for OfdMetadata
impl Clone for OfdMetadata
Source§fn clone(&self) -> OfdMetadata
fn clone(&self) -> OfdMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OfdMetadata
impl Debug for OfdMetadata
Source§impl Default for OfdMetadata
impl Default for OfdMetadata
Source§impl XmlElement for OfdMetadata
impl XmlElement for OfdMetadata
Source§fn element_name(&self) -> &'static str
fn element_name(&self) -> &'static str
对应 Java: org.ofdrw.core.basicStructure.ofd.docInfo.CT_DocInfo
仅序列化/反序列化 DocInfo 相关字段;非 XML 元素字段
(如 doc_dir、document_file 等)保持默认值。
Source§fn child_nodes(&self) -> Vec<XmlNode>
fn child_nodes(&self) -> Vec<XmlNode>
XmlNode 提供,便于嵌套序列化)。