ASPOSE Cells - Sign Microsoft Signature Line

Hi,

Is it possible to sign (not add) Microsoft Signature Line to an excel file? I want to sign on Microsoft Signature Line like in ASPOSE Word (See Example).

I can only “add” digital signature, but cannot “sign” to the existing digital signature line at the specified location in the Excel wookbook or worksheet.

Please let me know what I should do next.

@dietcheesecake,

How could you accomplish the task in MS Excel manually, please provide details and sample Excel file? If MS Excel allows this or supports this feature, then Aspose.Cells should also support this functionality as Aspose.Cells follows MS Excel standards and specifications.

Hi Amjad,

This is what I want to do. I can accomplish with ASPOSE.Word, but not with ASPOSE.Cells.

Best Regards,
Chokchai L,

(Attachment manual_sign.xlsx is missing)

@dietcheesecake,

Your sample file is missing, so you may zip the file prior attaching here. Moreover, we recommend you kindly check the following documents for your reference:

and

@dietcheesecake,

I have evaluated your requirements further. I think you may add a picture (or even use an existing picture in the sheet) and set its signature line in MS Excel via SignatureLine API, see the sample code segment for your reference:
e.g.
Sample code:

 Workbook workbook  = new Workbook(@"e:\test2\book2.xlsx");
            int index = workbook.Worksheets[0].Pictures.Add(0, 0, "e:\\test\\school.jpg");
            Picture pic = workbook.Worksheets[0].Pictures[index];
            SignatureLine s = new SignatureLine();
            s.Signer = "Michael";
            s.Title = "MMMMM";
            s.Email = "abc.ef@jkl.com";
            pic.SignatureLine = s;
            workbook.Save(@"e:\test2\out1.xlsx"); 

Let us know if this is what you want to do.

Dear Amjad,

Thank you for your reply, however, your example is not what I am looking for. I want to programmatically “sign” to the Excel file that has Microsoft Signature Line in the worksheet. The problem with your sample code is that it inserts another Signature Line to the worksheet at the specific location on my code. Is it possible to find the Signature Line object and digitally sign on that Signature Line object?

I should be able to insert my signature image and add a digital certificate to my signature.

After the sign process is complete, this excel file should give me the result below.

With Aspose.Words library, I can accomplish by using the following code

Before calling SignWordSignatureLine()

Result file (out_put_sign.docx)

Best Regards,
Chokchai L,

before_sign.zip (9.17 KB)

@dietcheesecake,

Thanks for the details.

I am afraid, currently Aspose.Cells does not support to digitally sign Microsoft Signature Line in Excel spreadsheets. A ticket is logged with an id “CELLSNET-47892” for your issue/requirements. We will look into it soon.

Once we support it, we will update you with supported version here.

@dietcheesecake

Signing Microsoft Signature Line is now Supported in the fix Aspose.Cells for .NET v21.2.8 (attached):
Aspose.Cells21.2.8 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.2.8 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.2.8 For .NetStandard20.Zip (5.5 MB)

Code:

Workbook wb = new Workbook("before_sign.xlsx");
SignatureLine signatureLine = wb.Worksheets[0].Pictures[0].SignatureLine;

X509Certificate2 certificate = new X509Certificate2(pfxPath, pfxPassword);
DigitalSignature signature =
    new DigitalSignature(certificate, "test Microsoft Office signature line", DateTime.UtcNow);
signature.Id = signatureLine.Id;
signature.ProviderId = signatureLine.ProviderId;
//sinature text, e.g. your name
//signature.Text = "signed by Aspose.Cells";
//Or signature Image
signature.Image = File.ReadAllBytes(imagePath);

DigitalSignatureCollection dsCollection = new DigitalSignatureCollection();
dsCollection.Add(signature);
wb.SetDigitalSignature(dsCollection);

wb.Save("output.xlsx", SaveFormat.Xlsx);

The issues you have found earlier (filed as CELLSNET-47892) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao