Aspose.Cellsを使用してExcelブック内に署名行を作成する

Aspose.Cellsを使用してExcelブック内に署名行を作成するためのJavaコード

以下のサンプルコードは、Picture.setSignatureLine()プロパティを使用して署名行を追加し、ブックを保存します。スクリーンショットは、Microsoft Excelでの出力ブックの外観を示しています。

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(CreateSignatureLine.class);
// Create workbook object
Workbook workbook = new Workbook();
// Insert picture of your choice
int index = workbook.getWorksheets().get(0).getPictures().add(0, 0, "signature.jpg");
// Access picture and add signature line inside it
Picture pic = workbook.getWorksheets().get(0).getPictures().get(index);
// Create signature line object
SignatureLine s = new SignatureLine();
s.setSigner("Simon Zhao");
s.setTitle("Development Lead");
s.setEmail("Simon.Zhao@aspose.com");
// Assign the signature line object to Picture.SignatureLine property
pic.setSignatureLine(s);
// Save the workbook
workbook.save(dataDir + "output.xlsx");