[]
Iterable<ISignature>An ISignatureSet provides access to the signatures in a workbook, including signature lines and non-visible signatures.
ISignatureSet signatures = workbook.getSignatures();
ISignature signature = signatures.addSignatureLine(worksheet, 100.0, 50.0);
ISignature firstSignature = signatures.get(0);
int count = signatures.getCount();
addSignatureLine(IWorksheet worksheet,
double left,
double top) addSignatureLine(IWorksheet worksheet,
double left,
double top,
double width) addSignatureLine(IWorksheet worksheet,
double left,
double top,
double width,
double height) get(int index) booleanintgetCount()ISignatureSet.booleanvoidsetSkipCertificateValidationOnExporting(boolean value) forEach, iterator, spliteratorThis property returns false if the workbook is already signed.
ISignatureSet signatures = workbook.getSignatures();
boolean canAddSignatureLine = signatures.getCanAddSignatureLine();
true if a signature line can be added to the document; otherwise, false.ISignatureSet.
ISignatureSet signatures = workbook.getSignatures();
IWorkbook parent = signatures.getParent();
ISignatureSet parentSignatures = parent.getSignatures();
ISignatureSet.Use this method to add a non-visible signature to the workbook's ISignatureSet. Unlike addSignatureLine(IWorksheet,double,double), the returned signature is not associated with a visible signature line in a worksheet. The signature will be discarded if you save the workbook without signing it.
ISignature signature = workbook.getSignatures().addNonVisibleSignature();
boolean isSignatureLine = signature.getIsSignatureLine();
ISignatureSet signatures = signature.getParent();
ISignature.Only the "Microsoft Office signature line" is supported. Other signature line providers, such as stamp signatures, are not supported. This overload adds the signature line shape to the specified worksheet with the specified width, and passes 100.5 as the height to addSignatureLine(IWorksheet,double,double,double,double).
ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0, 200.0);
ISignatureSetup setup = signature.getSetup();
setup.setSuggestedSigner("Test User");
worksheet - The worksheet that the signature line shape will be added to. Must not be null.left - The left position of the signature line shape.top - The top position of the signature line shape.width - The width of the signature line shape.ISignature object.IllegalStateException - if the workbook is in digital signature only mode.Only the "Microsoft Office signature line" is supported. Other signature line providers, such as stamp signatures, are not supported.
This overload forwards to addSignatureLine(IWorksheet,double,double,double,double) with a width of 192 and a height of 100.5.
ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0);
ISignatureSetup setup = signature.getSetup();
setup.setSuggestedSigner("John Williams");
setup.setSigningInstructions("Please review and sign this worksheet.");
worksheet - The worksheet to which the signature line shape is added.left - The left position of the signature line shape.top - The top position of the signature line shape.ISignature object.Only the Microsoft Office signature line is supported. Other signature line providers, such as stamp signatures, are not supported.
After the signature line is created, you can use ISignatureSetup to specify signer information and signing instructions.
ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0, 192.0, 100.5);
ISignatureSetup setup = signature.getSetup();
setup.setSuggestedSigner("Shinzo Nagama");
setup.setSigningInstructions("Please check the content before signing.");
worksheet - The worksheet to which the signature line shape is added.left - The distance, in points, from the left edge of the worksheet to the signature line shape.top - The distance, in points, from the top edge of the worksheet to the signature line shape.width - The width, in points, of the signature line shape.height - The height, in points, of the signature line shape.ISignature object.The default value is true. If certificate validation is skipped, the certificate is treated as valid. This is the default behavior. Otherwise, the certificate is validated with an X.509 chain.
ISignatureSet signatures = workbook.getSignatures();
signatures.setSkipCertificateValidationOnExporting(false);
boolean skipCertificateValidation = signatures.getSkipCertificateValidationOnExporting();
true if certificate validation is skipped when exporting signed signatures; otherwise, false if the certificate is validated with an X.509 chain.The default value is true. If certificate validation is skipped, the certificate is treated as valid. This is the default behavior. Otherwise, the certificate is validated with an X.509 chain.
ISignatureSet signatures = workbook.getSignatures();
signatures.setSkipCertificateValidationOnExporting(false);
value - true if certificate validation is skipped when exporting signed signatures; otherwise, false if the certificate is validated with an X.509 chain.
ISignatureSet signatures = workbook.getSignatures();
signatures.addNonVisibleSignature();
int count = signatures.getCount();
Use this method to retrieve a signature that was added to the workbook's signature set, including a signature line or a non-visible signature.
ISignatureSet signatures = workbook.getSignatures();
signatures.addSignatureLine(worksheet, 100.0, 50.0);
ISignature signature = signatures.get(0);
ISignatureSetup setup = signature.getSetup();
index - The index of the signature.