pub struct Watermark {
pub text: Option<String>,
pub image: Option<Vec<u8>>,
pub position: (f64, f64),
pub font_size: f64,
pub font: String,
pub color: u32,
pub opacity: f64,
pub rotation: f64,
pub page: Option<usize>,
}Expand description
水印配置。支持文本水印和图片水印。
Fields§
§text: Option<String>水印文本(文本水印)。
image: Option<Vec<u8>>水印图片数据(图片水印)。
position: (f64, f64)位置 (x, y) mm。
font_size: f64文本水印字号。
font: String文本水印字体。
color: u32文本颜色 RGB hex。
opacity: f64透明度 0.0(透明)– 1.0(不透明)。默认 0.3。
rotation: f64旋转角度(度)。默认 45.0(对角线)。
page: Option<usize>目标页码(1-based)。None = 所有页。
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Watermark
impl RefUnwindSafe for Watermark
impl Send for Watermark
impl Sync for Watermark
impl Unpin for Watermark
impl UnsafeUnpin for Watermark
impl UnwindSafe for Watermark
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