import groupdocs.signature as sg
def run():
# Choose the document to be signed
with sg.Signature('input.xlsx') as signature:
# Set up image options with the image file path
options = sg.ImageSignOptions("manager_signature.jpg")
# Specify the size of the image signature
options.Width = 100
options.Height = 100
# Position the image in the bottom-right corner of the page
options.VerticalAlignment = sg.VerticalAlignment.Bottom
options.HorizontalAlignment = sg.HorizontalAlignment.Right
# Apply padding from the page edges as needed
options.Margin = sg.Padding()
options.Margin.Bottom = 120
options.Margin.Right = 120
# Optionally, add a border around the image
options.Border = sg.Border()
options.Border.Visible = True
options.Border.Color = sg.Color.OrangeRed
options.Border.DashStyle = sg.DashStyle.DashDotDot
options.Border.Weight = 5
# Rotate the image to ensure proper alignment
options.RotationAngle = 45
# Save the updated document
result = signature.Sign("output.xlsx", options)