Skip to main content

WatermarkConfig

Struct WatermarkConfig 

Source
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-pptx text_frame.text / Aspose add_text_frame(text)
  • font_size_pt ↔ python-pptx font.size = Pt(n) / Aspose font_height
  • color_rgb ↔ python-pptx font.color.rgb / Aspose solid_fill_color
  • rotation_deg ↔ python-pptx shape.rotation / Aspose shape.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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for WatermarkConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WatermarkConfig

Source§

fn default() -> Self

默认水印配置:44pt 中灰色 “pptx-rs 水印”,45 度旋转。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V