public class Signature extends Object
Represents main class that controls document signing process.
Constructor and Description |
---|
Signature(InputStream document)
Initializes new instance of
Signature class with document provided by stream. |
Signature(InputStream document,
LoadOptions loadOptions)
Initializes new instance of
Signature class with document provided by stream and load options LoadOptions (getLoadOptions() /setLoadOptions(LoadOptions) ). |
Signature(InputStream document,
LoadOptions loadOptions,
SignatureSettings settings)
Initializes new instance of
Signature class instance with document provided by stream, load options LoadOptions (getLoadOptions() /setLoadOptions(LoadOptions) ) and settings SignatureSettings . |
Signature(InputStream document,
SignatureSettings settings)
Initializes new instance of
Signature class instance with document provided by stream and SignatureSettings . |
Signature(String filePath)
Initializes new instance of
Signature class instance with document provided by file path. |
Signature(String filePath,
LoadOptions loadOptions)
Initializes new instance of
Signature class instance with document provided by file path and LoadOptions (getLoadOptions() /setLoadOptions(LoadOptions) ). |
Signature(String filePath,
LoadOptions loadOptions,
SignatureSettings settings)
Initializes new instance of
Signature class instance with document provided by file path, LoadOptions (getLoadOptions() /setLoadOptions(LoadOptions) ) and SignatureSettings . |
Signature(String filePath,
SignatureSettings settings)
Initializes new instance of
Signature class instance with document provided by file path and SignatureSettings . |
Modifier and Type | Method and Description |
---|---|
DeleteResult |
delete(List<String> signatureIds)
Deletes passed list of signatures
BaseSignature from the document. |
boolean |
delete(OutputStream document,
BaseSignature signature)
Deletes passed signature
BaseSignature from the document. |
DeleteResult |
delete(OutputStream document,
int signatureType)
Deletes signatures of the certain type
SignatureType from the document. |
DeleteResult |
delete(OutputStream document,
List<BaseSignature> signatures)
Deletes passed list of signatures
BaseSignature from the document. |
boolean |
delete(String signatureId)
Deletes signature by its specific signature Id from the document.
|
boolean |
delete(String filePath,
BaseSignature signature)
Deletes passed signature
BaseSignature from the document. |
DeleteResult |
delete(String filePath,
int signatureType)
Deletes signatures of the certain type
SignatureType from the document. |
DeleteResult |
delete(String filePath,
List<BaseSignature> signatures)
Deletes passed list of signatures
BaseSignature from the document. |
DeleteResult |
deleteByTypes(OutputStream document,
List<Integer> signatureTypes)
Deletes the signatures of the certain types list
SignatureType from the document. |
DeleteResult |
deleteByTypes(String filePath,
List<Integer> signatureTypes)
Deletes the signatures of the certain types list
SignatureType from the document. |
void |
dispose()
Implement IDisposable interface to clean up internal resources
|
void |
generatePreview(PreviewOptions previewOptions)
Generates document pages preview.
|
static void |
generateSignaturePreview(PreviewSignatureOptions previewOptions)
Generates Signature preview based on given SignOptions.
|
IDocumentInfo |
getDocumentInfo()
Gets information about document pages: their sizes,
maximum page height, the width of a page with the maximum height.
|
<T extends BaseSignature> |
search(Class<T> typeOfT,
int signatureType)
Searches for exact type of signatures in the document by
SignatureType value. |
<T extends BaseSignature> |
search(Class<T> typeOfT,
SearchOptions searchOptions)
Searches for signatures in a document by
SearchOptions options. |
SearchResult |
search(int... signatureTypes)
Searches for specified signature types in the document by
SignatureType value. |
SearchResult |
search(List<SearchOptions> searchOptionsList)
Searches for signatures in a document by
SearchOptions list. |
SignResult |
sign(OutputStream document,
List<SignOptions> signOptionsList)
Signs document with collection of
SignOptions and saves result to a stream. |
SignResult |
sign(OutputStream document,
List<SignOptions> signOptionsList,
SaveOptions saveOptions)
Signs document with collection of
SignOptions and saves result to a stream with predefined SaveOptions . |
SignResult |
sign(OutputStream document,
SignOptions signOptions)
Signs document with
SignOptions and saves result to a stream. |
SignResult |
sign(OutputStream document,
SignOptions signOptions,
SaveOptions saveOptions)
Signs document with
SignOptions and saves result to a stream with predefined SaveOptions . |
SignResult |
sign(String filePath,
List<SignOptions> signOptionsList)
Signs document with collection of
SignOptions and saves result to specified file path. |
SignResult |
sign(String filePath,
List<SignOptions> signOptionsList,
SaveOptions saveOptions)
Signs document with collection of
SignOptions and saves result to specified file path with predefined SaveOptions . |
SignResult |
sign(String filePath,
SignOptions signOptions)
Signs document with
SignOptions and saves result to specified file path. |
SignResult |
sign(String filePath,
SignOptions signOptions,
SaveOptions saveOptions)
Signs document with
SignOptions and saves result to specified file path with predefined SaveOptions . |
boolean |
update(OutputStream document,
BaseSignature signature)
Updates passed signature
BaseSignature in the document. |
UpdateResult |
update(OutputStream document,
List<BaseSignature> signatures)
Updates passed signatures
BaseSignature in the document. |
boolean |
update(String filePath,
BaseSignature signature)
Updates passed signatures
BaseSignature in the document. |
UpdateResult |
update(String filePath,
List<BaseSignature> signatures)
Updates passed signatures
BaseSignature in the document. |
VerificationResult |
verify(List<VerifyOptions> verifyOptionsList)
Verifies the document signatures with list of VerifyOptions data.
|
VerificationResult |
verify(VerifyOptions verifyOptions)
Verifies the document signatures with given VerifyOptions data.
|
public Signature(InputStream document)
Initializes new instance of Signature
class with document provided by stream.
document
- The document content stream.
public Signature(InputStream document, LoadOptions loadOptions) throws Exception
Initializes new instance of Signature
class with document provided by stream and load options LoadOptions
(getLoadOptions()
/setLoadOptions(LoadOptions)
).
document
- The document content stream.loadOptions
- The document load options.
Exception
public Signature(InputStream document, LoadOptions loadOptions, SignatureSettings settings) throws Exception
Initializes new instance of Signature
class instance with document provided by stream, load options LoadOptions
(getLoadOptions()
/setLoadOptions(LoadOptions)
) and settings SignatureSettings
.
document
- The document content stream.loadOptions
- The document load options.settings
- The signature settings.
Exception
public Signature(InputStream document, SignatureSettings settings) throws Exception
Initializes new instance of Signature
class instance with document provided by stream and SignatureSettings
.
document
- The document content stream.settings
- The signature settings.
Exception
public Signature(String filePath)
Initializes new instance of Signature
class instance with document provided by file path.
filePath
- Absolute or relative file path.
public Signature(String filePath, LoadOptions loadOptions)
Initializes new instance of Signature
class instance with document provided by file path and LoadOptions
(getLoadOptions()
/setLoadOptions(LoadOptions)
).
filePath
- Absolute or relative file path.loadOptions
- The document load options.
public Signature(String filePath, LoadOptions loadOptions, SignatureSettings settings)
Initializes new instance of Signature
class instance with document provided by file path, LoadOptions
(getLoadOptions()
/setLoadOptions(LoadOptions)
) and SignatureSettings
.
filePath
- Absolute or relative file path.loadOptions
- The document load options.settings
- The signature settings.
public Signature(String filePath, SignatureSettings settings) throws Exception
Initializes new instance of Signature
class instance with document provided by file path and SignatureSettings
.
filePath
- Absolute or relative file path.settings
- The signature settings.
<b>Learn more</b>
Exception
public final DeleteResult delete(List<String> signatureIds) throws Exception
Deletes passed list of signatures BaseSignature
from the document.
signatureIds
- List of the identifiers of the signatures to be removed from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final boolean delete(OutputStream document, BaseSignature signature) throws Exception
Deletes passed signature BaseSignature
from the document.
document
- The output document stream.signature
- Signature object to be removed from the document.
Exception
public final DeleteResult delete(OutputStream document, int signatureType) throws Exception
Deletes signatures of the certain type SignatureType
from the document.
Only signatures that were added by Sign method and marked as Signatures BaseSignature.isSignature()
(BaseSignature.isSignature()
/BaseSignature.setSignature(boolean)
) will be removed.
Following signature types are supported: Text, Image, Digital, Barcode, QR-Code
document
- The output document stream.signatureType
- The type of signatures to be removed from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final DeleteResult delete(OutputStream document, List<BaseSignature> signatures) throws Exception
Deletes passed list of signatures BaseSignature
from the document.
document
- The output document stream.signatures
- List of signatures to remove from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final boolean delete(String signatureId) throws Exception
Deletes signature by its specific signature Id from the document.
signatureId
- The Id of the signature to be removed from the document.
Exception
public final boolean delete(String filePath, BaseSignature signature) throws Exception
Deletes passed signature BaseSignature
from the document.
filePath
- The output file path.signature
- Signature object to be removed from the document.
Exception
public final DeleteResult delete(String filePath, int signatureType) throws Exception
Deletes signatures of the certain type SignatureType
from the document.
Only signatures that were added by Sign method and marked as Signatures BaseSignature.isSignature()
(BaseSignature.isSignature()
/BaseSignature.setSignature(boolean)
) will be removed.
Following signature types are supported: Text, Image, Digital, Barcode, QR-Code
filePath
- The output file path.signatureType
- The type of signatures to be removed from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final DeleteResult delete(String filePath, List<BaseSignature> signatures) throws Exception
Deletes passed list of signatures BaseSignature
from the document.
filePath
- The output file path.signatures
- List of signatures to remove from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final DeleteResult deleteByTypes(OutputStream document, List<Integer> signatureTypes) throws Exception
Deletes the signatures of the certain types list SignatureType
from the document.
Only signatures that were added by Sign method and marked as Signatures BaseSignature.isSignature()
(BaseSignature.isSignature()
/BaseSignature.setSignature(boolean)
) will be removed.
Following signature types are supported: Text, Image, Digital, Barcode, QR-Code
document
- The output document stream.signatureTypes
- The list of signatures types to be removed from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final DeleteResult deleteByTypes(String filePath, List<Integer> signatureTypes) throws Exception
Deletes the signatures of the certain types list SignatureType
from the document.
Only signatures that were added by Sign method and marked as Signatures BaseSignature.isSignature()
(BaseSignature.isSignature()
/BaseSignature.setSignature(boolean)
) will be removed.
Following signature types are supported: Text, Image, Digital, Barcode, QR-Code
filePath
- The output file path.signatureTypes
- The list of signatures types to be removed from the document.
DeleteResult
with list of successfully deleted signatures and failed ones.Exception
public final void dispose() throws Exception
Implement IDisposable interface to clean up internal resources
Exception
public final void generatePreview(PreviewOptions previewOptions) throws Exception
Generates document pages preview.
previewOptions
- The preview options.
Exception
public static void generateSignaturePreview(PreviewSignatureOptions previewOptions) throws Exception
Generates Signature preview based on given SignOptions. SignOptions
previewOptions
- The preview signature with given SignOptions. PreviewSignatureOptions
Exception
public final IDocumentInfo getDocumentInfo() throws Exception
Gets information about document pages: their sizes, maximum page height, the width of a page with the maximum height.
Exception
public final <T extends BaseSignature> List<T> search(Class<T> typeOfT, int signatureType) throws Exception
Searches for exact type of signatures in the document by SignatureType
value.
signatureType
- The type of signatures to search.
Exception
public final <T extends BaseSignature> List<T> search(Class<T> typeOfT, SearchOptions searchOptions) throws Exception
Searches for signatures in a document by SearchOptions
options.
searchOptions
- The search options.
Exception
public final SearchResult search(int... signatureTypes) throws Exception
Searches for specified signature types in the document by SignatureType
value.
signatureTypes
- One or several types of signatures to find.
SearchResult
with list of found signatures.Exception
public final SearchResult search(List<SearchOptions> searchOptionsList) throws Exception
Searches for signatures in a document by SearchOptions
list.
searchOptionsList
- The search options collection.
SearchResult
with list of found Signatures.Exception
public final SignResult sign(OutputStream document, List<SignOptions> signOptionsList) throws Exception
Signs document with collection of SignOptions
and saves result to a stream.
document
- The output document stream.signOptionsList
- The list of signature options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(OutputStream document, List<SignOptions> signOptionsList, SaveOptions saveOptions) throws Exception
Signs document with collection of SignOptions
and saves result to a stream with predefined SaveOptions
.
document
- The output document stream.signOptionsList
- The list of signature options.saveOptions
- The save options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(OutputStream document, SignOptions signOptions) throws Exception
Signs document with SignOptions
and saves result to a stream.
document
- The output document stream.signOptions
- The signature options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(OutputStream document, SignOptions signOptions, SaveOptions saveOptions) throws Exception
Signs document with SignOptions
and saves result to a stream with predefined SaveOptions
.
document
- The output document stream.signOptions
- The signature options.saveOptions
- The save options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(String filePath, List<SignOptions> signOptionsList) throws Exception
Signs document with collection of SignOptions
and saves result to specified file path.
filePath
- The output file path.signOptionsList
- The list of signature options.
Exception
public final SignResult sign(String filePath, List<SignOptions> signOptionsList, SaveOptions saveOptions) throws Exception
Signs document with collection of SignOptions
and saves result to specified file path with predefined SaveOptions
.
filePath
- The output file path.signOptionsList
- The list of signature options.saveOptions
- The save options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(String filePath, SignOptions signOptions) throws Exception
Signs document with SignOptions
and saves result to specified file path.
filePath
- The output file path.signOptions
- The signature options.
SignResult
with list of newly created signatures.Exception
public final SignResult sign(String filePath, SignOptions signOptions, SaveOptions saveOptions) throws Exception
Signs document with SignOptions
and saves result to specified file path with predefined SaveOptions
.
filePath
- The output file path.signOptions
- The signature options.saveOptions
- The save options.
SignResult
with list of newly created signatures.Exception
public final boolean update(OutputStream document, BaseSignature signature) throws Exception
Updates passed signature BaseSignature
in the document.
document
- The output document stream.signature
- Signature object to be updated in the document.
Exception
public final UpdateResult update(OutputStream document, List<BaseSignature> signatures) throws Exception
Updates passed signatures BaseSignature
in the document.
document
- The output document stream.signatures
- List of signatures to update in the document.
UpdateResult
with list of successfully updated signatures and failed ones.Exception
public final boolean update(String filePath, BaseSignature signature) throws Exception
Updates passed signatures BaseSignature
in the document.
filePath
- The output file path.signature
- Signature object to be updated in the document.
UpdateResult
with list of successfully updated signatures and failed ones.Exception
public final UpdateResult update(String filePath, List<BaseSignature> signatures) throws Exception
Updates passed signatures BaseSignature
in the document.
filePath
- The output file path.signatures
- List of signatures to update in the document.
UpdateResult
with list of successfully updated signatures and failed ones.Exception
public final VerificationResult verify(List<VerifyOptions> verifyOptionsList) throws Exception
Verifies the document signatures with list of VerifyOptions data.
verifyOptionsList
- The signature verification options collection. Instance of VerifyOptionsCollection
.
VerificationResult
. Property VerificationResult.IsValid returns true if verification process was successful.Exception
public final VerificationResult verify(VerifyOptions verifyOptions) throws Exception
Verifies the document signatures with given VerifyOptions data.
verifyOptions
- The signature verification options.
VerificationResult
. Property VerificationResult.IsValid returns true if verification process was successful.Exception