Set Line Spacing of the Paragraph in a Shape or Textbox

Contents
[ ]

The following sample code explains the usage of the mentioned properties.

from aspose.cells import SaveFormat, Workbook
from aspose.cells.drawing.texts import LineSpaceSizeType
# 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 a workbook
wb = Workbook()
# Access first worksheet
ws = wb.worksheets[0]
# Add text box inside the sheet
ws.shapes.add_text_box(2, 0, 2, 0, 100, 200)
# Access first shape which is a text box and set is text
shape = ws.shapes[0]
shape.text = "Sign up for your free phone number.\nCall and text online for free."
# Acccess the first paragraph
p = shape.text_body.text_paragraphs[1]
# Set the line space
p.line_space_size_type = LineSpaceSizeType.POINTS
p.line_space = 20.0
# Set the space after
p.space_after_size_type = LineSpaceSizeType.POINTS
p.space_after = 10.0
# Set the space before
p.space_before_size_type = LineSpaceSizeType.POINTS
p.space_before = 10.0
# Save the workbook in xlsx format
wb.save(dataDir + "output_out.xlsx", SaveFormat.XLSX)