添加反射效果
让我们创建一个新的 Word 文档,并向其中添加带有反射效果的文本。 首先,创建一个名为 doc 的新 WordDocument 对象。 然后实例化一个TextStyle对象,并通过将其TextEffect属性设置为一个新的Reflection对象来配置该对象,从而添加反射效果。 将样式化的文本"Hello World"添加到文档中,并应用反射效果。 最后,文档保存完毕。
准备开始了吗?
Nuget 下载 28,054 | 版本: 2025.12 刚刚发布
using IronWord;
using IronWord.Models;
// Create new Word document
WordDocument doc = new WordDocument();
// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
ReflectionEffect = new Reflection(),
};
// Add text with style
doc.AddText("Hello World").Style = textStyle;
// Export new Word document
doc.SaveAs("reflectionEffect.docx");Imports IronWord
Imports IronWord.Models
' Create new Word document
Private doc As New WordDocument()
' Create and configure text style
Private textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {.ReflectionEffect = New Reflection()}
' Add text with style
doc.AddText("Hello World").Style = textStyle
' Export new Word document
doc.SaveAs("reflectionEffect.docx")Install-Package IronWord
让我们创建一个新的 Word 文档,并向其中添加带有反射效果的文本。 首先,创建一个名为 doc 的新 WordDocument 对象。 然后实例化一个TextStyle对象,并通过将其TextEffect属性设置为一个新的Reflection对象来配置该对象,从而添加反射效果。 将样式化的文本"Hello World"添加到文档中,并应用反射效果。 最后,文档保存完毕。