添加反射效果
让我们创建一个新的Word文档,并向其中添加带有反射效果的文本。 最初,创建了一个名为WordDocument的新对象 doc。 然后实例化一个TextStyle对象,并通过将其TextEffect属性设置为新的Reflection对象,以包括反射效果。 带有反射效果的“Hello World”样式文本已添加到文档中。 最后,文档被保存了。 有关更多示例和演示,请导航到以下文章:如何为文本添加反射效果。
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文档,并向其中添加带有反射效果的文本。 最初,创建了一个名为WordDocument的新对象 doc。 然后实例化一个TextStyle对象,并通过将其TextEffect属性设置为新的Reflection对象,以包括反射效果。 带有反射效果的“Hello World”样式文本已添加到文档中。 最后,文档被保存了。 有关更多示例和演示,请导航到以下文章:如何为文本添加反射效果。