新增反射效果
讓我們建立一個新的 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"加入到文件中,並套用反射效果。 最後,文檔保存完畢。