添加具有内置样式的艺术字文本
Contents
[
Hide
]
可能的使用场景
你可以使用 Aspose.Cells for Python via .NET 添加带有内置样式的Word Art文字。请使用 ShapeCollection.add_word_art() 方法。
添加具有内置样式的艺术字文本
以下示例代码使用不同的内置样式添加Word Art文本。请使用[code]output excel file[/code]检查使用此代码生成的输出excel文件。这是输出excel文件在Microsoft Excel中的外观。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import Workbook | |
from aspose.cells.drawing import PresetWordArtStyle | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create workbook object | |
wb = Workbook() | |
# Access first worksheet | |
ws = wb.worksheets[0] | |
# Add Word Art Text with Built-in Styles | |
ws.shapes.add_word_art(PresetWordArtStyle.WORD_ART_STYLE1, "Aspose File Format APIs", 00, 0, 0, 0, 100, 800) | |
ws.shapes.add_word_art(PresetWordArtStyle.WORD_ART_STYLE2, "Aspose File Format APIs", 10, 0, 0, 0, 100, 800) | |
ws.shapes.add_word_art(PresetWordArtStyle.WORD_ART_STYLE3, "Aspose File Format APIs", 20, 0, 0, 0, 100, 800) | |
ws.shapes.add_word_art(PresetWordArtStyle.WORD_ART_STYLE4, "Aspose File Format APIs", 30, 0, 0, 0, 100, 800) | |
ws.shapes.add_word_art(PresetWordArtStyle.WORD_ART_STYLE5, "Aspose File Format APIs", 40, 0, 0, 0, 100, 800) | |
# Save the workbook in xlsx format | |
wb.save(dataDir + "output_out.xlsx") |