Add Signature Line to the Worksheet with Node.js via C++

Introduction

Aspose.Cells provides the Picture.getSignatureLine() property to add a signature line to a worksheet.

How to Add Signature Line to Worksheet

The following sample code demonstrates how to make use of the Picture.getSignatureLine() property to add a signature line to a worksheet. The screenshot shows the effect of the sample code on the sample Excel file after execution.

todo:image_alt_text

Sample Code

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Instantiating a Workbook object
const wb = new AsposeCells.Workbook();

const signatureLine = new AsposeCells.SignatureLine();
signatureLine.setSigner("Aspose.Cells");
signatureLine.setTitle("signed by Aspose.Cells");
wb.getWorksheets().get(0).getShapes().addSignatureLine(1, 1, signatureLine);

const certificatePath = path.join(dataDir, "AsposeDemo.pfx");
const signature = new AsposeCells.DigitalSignature(
    certificatePath,
    "aspose",
    "test Microsoft Office signature line",
    new Date()
);

const dsCollection = new AsposeCells.DigitalSignatureCollection();
dsCollection.add(signature);
wb.setDigitalSignature(dsCollection);
wb.save(path.join(dataDir, "signatureLine.xlsx"));