在Excel工作簿中创建签名行
Contents
[
Hide
]
介绍
Microsoft Excel提供了在Excel工作簿中添加 签名行 的功能。您可以通过单击 插入 选项卡,然后从 文本 组中选择 签名行 来添加签名行。
如何为Excel创建签名行
Aspose.Cells for Python via .NET还提供此功能,并暴露Picture.signature_line属性供此用途。本文将说明如何使用此属性在Aspose.Cells for Python via .NET中添加签名行。
以下示例代码使用 Picture.signature_line 属性添加了一个签名行并保存了工作簿。
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 SignatureLine | |
# 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 | |
workbook = Workbook() | |
# Insert picture of your choice | |
index = workbook.worksheets[0].pictures.add(0, 0, dataDir + "signature.jpg") | |
# Access picture and add signature line inside it | |
pic = workbook.worksheets[0].pictures[index] | |
# Create signature line object | |
s = SignatureLine() | |
s.signer = "John Doe" | |
s.title = "Development Lead" | |
s.email = "john.doe@aspose.com" | |
# Assign the signature line object to Picture.SignatureLine property | |
pic.signature_line = s | |
# Save the workbook | |
workbook.save(dataDir + "output_out.xlsx") |