public class SignatureOptions
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIGNATURE_SIZE |
private int |
pageNo |
private RandomAccessRead |
pdfSource |
private int |
preferredSignatureSize |
private COSDocument |
visualSignature |
Constructor and Description |
---|
SignatureOptions()
Creates the default signature options.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the visual signature COSDocument, if any.
|
int |
getPage()
Get the 0-based page number.
|
int |
getPreferredSignatureSize()
Get the preferred size of the signature.
|
COSDocument |
getVisualSignature()
Get the visual signature.
|
private void |
initFromRandomAccessRead(RandomAccessRead rar) |
void |
setPage(int pageNo)
Set the 0-based page number.
|
void |
setPreferredSignatureSize(int size)
Set the preferred size of the signature.
|
void |
setVisualSignature(java.io.File file)
Reads the visual signature from the given file.
|
void |
setVisualSignature(java.io.InputStream is)
Reads the visual signature from the given input stream.
|
void |
setVisualSignature(PDVisibleSigProperties visSignatureProperties)
Reads the visual signature from the given visual signature properties
|
private COSDocument visualSignature
private int preferredSignatureSize
private int pageNo
private RandomAccessRead pdfSource
public static final int DEFAULT_SIGNATURE_SIZE
public SignatureOptions()
public void setPage(int pageNo)
pageNo
- the page numberpublic int getPage()
public void setVisualSignature(java.io.File file) throws java.io.IOException
file
- the file containing the visual signaturejava.io.IOException
- when something went wrong during parsingpublic void setVisualSignature(java.io.InputStream is) throws java.io.IOException
is
- the input stream containing the visual signaturejava.io.IOException
- when something went wrong during parsingprivate void initFromRandomAccessRead(RandomAccessRead rar) throws java.io.IOException
java.io.IOException
public void setVisualSignature(PDVisibleSigProperties visSignatureProperties) throws java.io.IOException
visSignatureProperties
- the PDVisibleSigProperties
object containing the
visual signaturejava.io.IOException
- when something went wrong during parsingpublic COSDocument getVisualSignature()
public int getPreferredSignatureSize()
public void setPreferredSignatureSize(int size)
size
- the size of the signature in bytes. Only values above 0 will be considered.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- if the document could not be closed