pub struct DocxTemplate { /* private fields */ }Implementations§
Source§impl DocxTemplate
impl DocxTemplate
pub fn new() -> Self
Sourcepub fn add_text_replacement(&mut self, placeholder: &str, value: &str)
pub fn add_text_replacement(&mut self, placeholder: &str, value: &str)
添加待替换的字符以及对应的值 @param placeholder 待替换的字符串 @param value 替换的值
Sourcepub fn add_image_file_replacement(
&mut self,
placeholder: &str,
image_path: Option<&str>,
) -> Result<(), DocxError>
pub fn add_image_file_replacement( &mut self, placeholder: &str, image_path: Option<&str>, ) -> Result<(), DocxError>
添加待替换的图片 @param placeholder 待替换的字符串 @param image_path 图片路径
Sourcepub fn add_image_file_size_replacement(
&mut self,
placeholder: &str,
image_path: Option<&str>,
width: f32,
height: f32,
) -> Result<(), DocxError>
pub fn add_image_file_size_replacement( &mut self, placeholder: &str, image_path: Option<&str>, width: f32, height: f32, ) -> Result<(), DocxError>
添加待替换的图片 @param placeholder 替换的字符串 @param image_path 图片路径 @param width 图片的宽度(厘米) @param height 图片的高度(厘米)
Sourcepub async fn add_image_url_replacement(
&mut self,
placeholder: &str,
image_url: Option<&str>,
) -> Result<(), DocxError>
pub async fn add_image_url_replacement( &mut self, placeholder: &str, image_url: Option<&str>, ) -> Result<(), DocxError>
添加待替换的图片,替换的图片大小默认6.09*5.9厘米 @param placeholder 替换的字符串 @param image_url 图片路径
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocxTemplate
impl !RefUnwindSafe for DocxTemplate
impl Send for DocxTemplate
impl Sync for DocxTemplate
impl Unpin for DocxTemplate
impl !UnwindSafe for DocxTemplate
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().