Crea LINEA FIRMA in un workbook Excel utilizzando Aspose.Cells
Microsoft Excel fornisce la funzionalità di aggiungere Linea firma in workbook Excel. È possibile aggiungere una linea di firma facendo clic sulla scheda Inserisci e quindi selezionando Linea firma dal gruppo Testo.
Aspose.Cells fornisce anche questa funzionalità ed ha esposto la proprietà Picture.setSignatureLine() a questo scopo. Questo articolo spiegherà come utilizzare questa proprietà per aggiungere una linea di firma utilizzando Aspose.Cells.
Codice Java per creare una Linea di Firma in un Foglio di Lavoro Excel utilizzando Aspose.Cells
Il seguente codice di esempio aggiunge una Linea di Firma utilizzando la proprietà Picture.setSignatureLine() e salva il foglio di lavoro. La schermata mostra come appare il foglio di lavoro di output in Microsoft Excel.
// 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"); |