Excel API Library for Java - Sample Browser | Document Solutions | Delete signature lines
[
フレーム]
src="bundle.js">
Delete signature lines through IShape or ISignature.
// Create a new workbook
Workbook workbook = new Workbook();
IWorksheet activeSheet = workbook.getActiveSheet();
// Create a anonymous class for creating new signature line with predefined data
Callable newSignatureLine = new Callable() {
@Override
public ISignature call() throws Exception {
ISignature signature = workbook.getSignatures().addSignatureLine(activeSheet, 100.0, 50.0);
ISignatureSetup setup = signature.getSetup();
setup.setShowSignDate(false);
setup.setAllowComments(false);
setup.setSigningInstructions("Please check the content before signing.");
setup.setSuggestedSigner("Shinzo Nagama");
setup.setSuggestedSignerEmail("shinzo.nagama@ea.com");
setup.setSuggestedSignerLine2("Commander (Balanced)");
return signature;
}
};
// Create a new signature line and delete with Signature.Delete
ISignature signatureForTest;
try {
signatureForTest = newSignatureLine.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
signatureForTest.delete();
// Create a new signature line and delete with Shape.Delete
try {
signatureForTest = newSignatureLine.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
IShape signatureLineShape = signatureForTest.getSignatureLineShape();
signatureLineShape.delete();
// Save to an excel file
workbook.save("DeleteSignatureLines.xlsx");
// Create a new workbook
var workbook = Workbook()
val activeSheet: IWorksheet = workbook.getActiveSheet()
// Create a anonymous class for creating new signature line with predefined data
val newSignatureLine: Callable
= Callable {
val signature: ISignature = workbook.getSignatures().addSignatureLine(activeSheet, 100.0, 50.0)
val setup: ISignatureSetup = signature.getSetup()
setup.setShowSignDate(false)
setup.setAllowComments(false)
setup.setSigningInstructions("Please check the content before signing.")
setup.setSuggestedSigner("Shinzo Nagama")
setup.setSuggestedSignerEmail("shinzo.nagama@ea.com")
setup.setSuggestedSignerLine2("Commander (Balanced)")
signature
}
// Create a new signature line and delete with Signature.Delete
var signatureForTest: ISignature
signatureForTest = try {
newSignatureLine.call()
} catch (e: Exception) {
throw RuntimeException(e)
}
signatureForTest.delete()
// Create a new signature line and delete with Shape.Delete
signatureForTest = try {
newSignatureLine.call()
} catch (e: Exception) {
throw RuntimeException(e)
}
val signatureLineShape: IShape = signatureForTest.getSignatureLineShape()
signatureLineShape.delete()
// Save to an excel file
workbook.save("DeleteSignatureLines.xlsx")