pub struct OfdPage {
pub width: f64,
pub height: f64,
pub content: Vec<ContentObject>,
pub base_path: Option<String>,
}Expand description
OFD 文档中的单个页面。
Fields§
§width: f64页面宽度(mm)。
height: f64页面高度(mm)。
content: Vec<ContentObject>此页面上的内容块。
base_path: Option<String>原始页面路径(相对文档目录,如 "Pages/Page_Insert_55_2/Content.xml")。
读取 OFD 文件时保留,写入器优先使用该路径而非自动命名
(Pages/Page_N/Content.xml),从而在 roundtrip 时保持页面路径一致。
Implementations§
Source§impl OfdPage
impl OfdPage
Sourcepub fn with_base_path(self, path: impl Into<String>) -> Self
pub fn with_base_path(self, path: impl Into<String>) -> Self
设置原始页面路径(roundtrip 保留页面路径时使用)。
Sourcepub fn add_text(&mut self, text: TextObject)
pub fn add_text(&mut self, text: TextObject)
向此页面添加文本对象。
Sourcepub fn add_image(&mut self, image: ImageObject)
pub fn add_image(&mut self, image: ImageObject)
向此页面添加图片对象。
Sourcepub fn add_path(&mut self, path: PathObject)
pub fn add_path(&mut self, path: PathObject)
向此页面添加路径对象。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OfdPage
impl RefUnwindSafe for OfdPage
impl Send for OfdPage
impl Sync for OfdPage
impl Unpin for OfdPage
impl UnsafeUnpin for OfdPage
impl UnwindSafe for OfdPage
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