pub struct WatermarkConfig {
pub text: String,
pub font_size_pt: u16,
pub color_rgb: (u8, u8, u8),
pub rotation_deg: i32,
}Expand description
水印配置参数。
参考 python-pptx 的 shapes.add_textbox() + font 组合 API 和
Aspose.Slides 的 PortionFormat 参数化模式,将水印的可变属性集中管理,
避免硬编码散落在 build_watermark_spcontainer 各处。
§字段对应关系
text↔ python-pptxtext_frame.text/ Asposeadd_text_frame(text)font_size_pt↔ python-pptxfont.size = Pt(n)/ Asposefont_heightcolor_rgb↔ python-pptxfont.color.rgb/ Asposesolid_fill_colorrotation_deg↔ python-pptxshape.rotation/ Asposeshape.rotation
§示例
use pptx_rs::ppt97::watermark::WatermarkConfig;
let config = WatermarkConfig {
text: "机密".to_string(),
font_size_pt: 72,
color_rgb: (180, 180, 180),
rotation_deg: -30,
};Fields§
§text: String水印文本内容。
font_size_pt: u16字号(磅),常见水印字号 44pt。
color_rgb: (u8, u8, u8)文字颜色 (r, g, b),每个分量 0-255。
rotation_deg: i32旋转角度(度),正值顺时针,负值逆时针。
Trait Implementations§
Source§impl Clone for WatermarkConfig
impl Clone for WatermarkConfig
Source§fn clone(&self) -> WatermarkConfig
fn clone(&self) -> WatermarkConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WatermarkConfig
impl Debug for WatermarkConfig
Auto Trait Implementations§
impl Freeze for WatermarkConfig
impl RefUnwindSafe for WatermarkConfig
impl Send for WatermarkConfig
impl Sync for WatermarkConfig
impl Unpin for WatermarkConfig
impl UnsafeUnpin for WatermarkConfig
impl UnwindSafe for WatermarkConfig
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