Create Signature Line in an Excel Workbook

Introduction

Microsoft Excel provides a feature to add Signature Line in Excel workbooks. You can add a Signature Line by clicking the Insert Tab and then selecting Signature Line from the Text group.

How to Create Signature Line for Excel

Aspose.Cells for Python via .NET also provides this feature and has exposed the Picture.signature_line property for this purpose. This article will explain how to use this property to add a Signature Line using Aspose.Cells for Python via .NET.

The following sample code adds a Signature Line using Picture.signature_line property and saves the workbook.

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")