Package com.lowagie.text.pdf
Class PdfSignatureAppearance
- java.lang.Object
-
- com.lowagie.text.pdf.PdfSignatureAppearance
-
public class PdfSignatureAppearance extends java.lang.Object
This class takes care of the cryptographic options and appearances that form a signature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PdfSignatureAppearance.RangeStream
static interface
PdfSignatureAppearance.SignatureEvent
An interface to retrieve the signature dictionary for modification.
-
Field Summary
Fields Modifier and Type Field Description private boolean
acro6Layers
Holds value of property acro6Layers.private PdfTemplate[]
app
private byte[]
bout
private int
boutLen
private java.security.cert.Certificate[]
certChain
private int
certificationLevel
static int
CERTIFIED_ALL_CHANGES_ALLOWED
static int
CERTIFIED_FORM_FILLING
static int
CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
static int
CERTIFIED_NO_CHANGES_ALLOWED
private java.lang.String
contact
Holds value of property contact.private java.security.cert.CRL[]
crlList
private PdfDictionary
cryptoDictionary
private java.lang.String
digestEncryptionAlgorithm
private java.util.Map<PdfName,PdfLiteral>
exclusionLocations
private byte[]
externalDigest
private byte[]
externalRSAdata
private java.lang.String
fieldName
private PdfName
filter
private PdfTemplate
frm
private Image
image
Holds value of property image.private float
imageScale
Holds value of property imageScale.private Font
layer2Font
Holds value of property layer2Font.private java.lang.String
layer2Text
private java.lang.String
layer4Text
Holds value of property layer4Text.private java.lang.String
location
private static float
MARGIN
private boolean
newField
static int
NOT_CERTIFIED
private java.io.OutputStream
originalout
private int
page
private Rectangle
pageRect
private boolean
preClosed
private java.security.PrivateKey
privKey
private java.lang.String
provider
static java.lang.String
questionMark
Commands to draw a yellow question mark in a stream contentprivate java.io.RandomAccessFile
raf
private long[]
range
private java.lang.String
reason
private Rectangle
rect
private int
render
private int
runDirection
Holds value of property runDirection.static PdfName
SELF_SIGNED
The self signed filter.private PdfSignatureAppearance.SignatureEvent
signatureEvent
Holds value of property signatureEvent.private Image
signatureGraphic
static int
SignatureRenderDescription
The rendering mode is just the descriptionstatic int
SignatureRenderGraphic
The rendering mode is an image and the descriptionstatic int
SignatureRenderGraphicAndDescription
The rendering mode is an image and the descriptionstatic int
SignatureRenderNameAndDescription
The rendering mode is the name of the signer and the descriptionprivate java.util.Calendar
signDate
private ByteBuffer
sigout
private PdfSigGenericPKCS
sigStandard
private PdfStamper
stamper
private java.io.File
tempFile
private static float
TOP_SECTION
static PdfName
VERISIGN_SIGNED
The VeriSign filter.static PdfName
WINCER_SIGNED
The Windows Certificate Security.private PdfStamperImp
writer
-
Constructor Summary
Constructors Constructor Description PdfSignatureAppearance(PdfStamperImp writer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addDocMDP(PdfDictionary crypto)
void
close(PdfDictionary update)
This is the last method to be called when using external signatures.static float
fitText(Font font, java.lang.String text, Rectangle rect, float maxFontSize, int runDirection)
Fits the text to some rectangle adjusting the font size as needed.PdfTemplate
getAppearance()
Gets the main appearance layer.int
getCertificationLevel()
Gets the certified status of this document.java.lang.String
getContact()
Gets the signing contact.java.security.cert.CRL[]
getCrlList()
Gets the certificate revocation list.PdfDictionary
getCryptoDictionary()
Gets the user made signature dictionary.java.lang.String
getFieldName()
Gets the field name.PdfName
getFilter()
Gets the filter used to sign the document.Image
getImage()
Gets the background image for the layer 2.float
getImageScale()
Gets the scaling to be applied to the background image.PdfTemplate
getLayer(int layer)
Gets a template layer to create a signature appearance.Font
getLayer2Font()
Gets the n2 and n4 layer font.java.lang.String
getLayer2Text()
Gets the signature text identifying the signer if set by setLayer2Text().java.lang.String
getLayer4Text()
Gets the text identifying the signature status if set by setLayer4Text().java.lang.String
getLocation()
Gets the signing location or null if not set.java.lang.String
getNewSigName()
Gets a new signature fied name that doesn't clash with any existing name.(package private) java.io.OutputStream
getOriginalout()
int
getPage()
Gets the page number of the field.Rectangle
getPageRect()
Gets the rectangle that represent the position and dimension of the signature in the page.java.security.PrivateKey
getPrivKey()
Gets the private key.java.lang.String
getProvider()
Returns the Cryptographic Service Provider that will sign the document.java.io.InputStream
getRangeStream()
Gets the document bytes that are hashable when using external signatures.java.lang.String
getReason()
Gets the signing reason or null if not set.Rectangle
getRect()
Gets the rectangle representing the signature dimensions.int
getRender()
Gets the rendering mode for this signature.int
getRunDirection()
Gets the run direction.PdfSignatureAppearance.SignatureEvent
getSignatureEvent()
Getter for property signatureEvent.Image
getSignatureGraphic()
Gets the Image object to render.java.util.Calendar
getSignDate()
Gets the signature date.java.util.Calendar
getSignDateNullSafe()
Gets the signature date.(package private) ByteBuffer
getSigout()
PdfSigGenericPKCS
getSigStandard()
Gets the instance of the standard signature dictionary.PdfStamper
getStamper()
Gets thePdfStamper
associated with this instance.java.io.File
getTempFile()
Gets the temporary file.PdfTemplate
getTopLayer()
Gets the template that aggregates all appearance layers.boolean
isAcro6Layers()
Gets the Acrobat 6.0 layer mode.boolean
isInvisible()
Gets the visibility status of the signature.boolean
isNewField()
Checks if a new field was created.boolean
isPreClosed()
Checks if the document is in the process of closing.void
preClose()
This is the first method to be called when using external signatures.void
preClose(java.util.Map<PdfName,java.lang.Integer> exclusionSizes)
This is the first method to be called when using external signatures.void
setAcro6Layers(boolean acro6Layers)
Acrobat 6.0 and higher recommends that only layer n2 and n4 be present.void
setCertificationLevel(int certificationLevel)
Sets the document type to certified instead of simply signed.void
setContact(java.lang.String contact)
Sets the signing contact.void
setCrypto(java.security.PrivateKey privKey, java.security.cert.Certificate[] certChain, java.security.cert.CRL[] crlList, PdfName filter)
Sets the cryptographic parameters.void
setCrypto(java.security.PrivateKey privKey, java.security.cert.X509Certificate certificate, java.security.cert.CRL crl, PdfName filter)
Sets the cryptographic parameters.void
setCryptoDictionary(PdfDictionary cryptoDictionary)
Sets a user made signature dictionary.void
setExternalDigest(byte[] digest, byte[] RSAdata, java.lang.String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.void
setFieldNameForInvisibleSignatures(java.lang.String fieldName)
Sets the field name for a new invisible signature fieldvoid
setImage(Image image)
Sets the background image for the layer 2.void
setImageScale(float imageScale)
Sets the scaling to be applied to the background image.void
setLayer2Font(Font layer2Font)
Sets the n2 and n4 layer font.void
setLayer2Text(java.lang.String text)
Sets the signature text identifying the signer.void
setLayer4Text(java.lang.String text)
Sets the text identifying the signature status.void
setLocation(java.lang.String location)
Sets the signing location.(package private) void
setOriginalout(java.io.OutputStream originalout)
void
setProvider(java.lang.String provider)
Sets the Cryptographic Service Provider that will sign the document.void
setReason(java.lang.String reason)
Sets the signing reason.void
setRender(int render)
Sets the rendering mode for this signature.void
setRunDirection(int runDirection)
Sets the run direction in the n2 and n4 layer.void
setSignatureEvent(PdfSignatureAppearance.SignatureEvent signatureEvent)
Sets the signature event to allow modification of the signature dictionary.void
setSignatureGraphic(Image signatureGraphic)
Sets the Image object to render when Render is set toSignatureRenderGraphicAndDescription
void
setSignDate(java.util.Calendar signDate)
Sets the signature date.(package private) void
setSigout(ByteBuffer sigout)
(package private) void
setStamper(PdfStamper stamper)
(package private) void
setTempFile(java.io.File tempFile)
void
setVisibleSignature(Rectangle pageRect, int page)
void
setVisibleSignature(Rectangle pageRect, int page, java.lang.String fieldName)
Sets the signature to be visible.void
setVisibleSignature(java.lang.String fieldName)
Sets the signature to be visible.
-
-
-
Field Detail
-
SignatureRenderDescription
public static final int SignatureRenderDescription
The rendering mode is just the description- See Also:
- Constant Field Values
-
SignatureRenderNameAndDescription
public static final int SignatureRenderNameAndDescription
The rendering mode is the name of the signer and the description- See Also:
- Constant Field Values
-
SignatureRenderGraphicAndDescription
public static final int SignatureRenderGraphicAndDescription
The rendering mode is an image and the description- See Also:
- Constant Field Values
-
SignatureRenderGraphic
public static final int SignatureRenderGraphic
The rendering mode is an image and the description- See Also:
- Constant Field Values
-
SELF_SIGNED
public static final PdfName SELF_SIGNED
The self signed filter.
-
VERISIGN_SIGNED
public static final PdfName VERISIGN_SIGNED
The VeriSign filter.
-
WINCER_SIGNED
public static final PdfName WINCER_SIGNED
The Windows Certificate Security.
-
NOT_CERTIFIED
public static final int NOT_CERTIFIED
- See Also:
- Constant Field Values
-
CERTIFIED_ALL_CHANGES_ALLOWED
public static final int CERTIFIED_ALL_CHANGES_ALLOWED
- See Also:
- Constant Field Values
-
CERTIFIED_NO_CHANGES_ALLOWED
public static final int CERTIFIED_NO_CHANGES_ALLOWED
- See Also:
- Constant Field Values
-
CERTIFIED_FORM_FILLING
public static final int CERTIFIED_FORM_FILLING
- See Also:
- Constant Field Values
-
CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
public static final int CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
- See Also:
- Constant Field Values
-
questionMark
public static final java.lang.String questionMark
Commands to draw a yellow question mark in a stream content- See Also:
- Constant Field Values
-
TOP_SECTION
private static final float TOP_SECTION
- See Also:
- Constant Field Values
-
MARGIN
private static final float MARGIN
- See Also:
- Constant Field Values
-
app
private final PdfTemplate[] app
-
writer
private final PdfStamperImp writer
-
rect
private Rectangle rect
-
pageRect
private Rectangle pageRect
-
frm
private PdfTemplate frm
-
layer2Text
private java.lang.String layer2Text
-
reason
private java.lang.String reason
-
location
private java.lang.String location
-
signDate
private java.util.Calendar signDate
-
provider
private java.lang.String provider
-
page
private int page
-
fieldName
private java.lang.String fieldName
-
privKey
private java.security.PrivateKey privKey
-
crlList
private java.security.cert.CRL[] crlList
-
filter
private PdfName filter
-
newField
private boolean newField
-
sigout
private ByteBuffer sigout
-
originalout
private java.io.OutputStream originalout
-
tempFile
private java.io.File tempFile
-
cryptoDictionary
private PdfDictionary cryptoDictionary
-
stamper
private PdfStamper stamper
-
preClosed
private boolean preClosed
-
sigStandard
private PdfSigGenericPKCS sigStandard
-
range
private long[] range
-
raf
private java.io.RandomAccessFile raf
-
bout
private byte[] bout
-
boutLen
private int boutLen
-
externalDigest
private byte[] externalDigest
-
externalRSAdata
private byte[] externalRSAdata
-
digestEncryptionAlgorithm
private java.lang.String digestEncryptionAlgorithm
-
exclusionLocations
private java.util.Map<PdfName,PdfLiteral> exclusionLocations
-
certChain
private java.security.cert.Certificate[] certChain
-
render
private int render
-
signatureGraphic
private Image signatureGraphic
-
contact
private java.lang.String contact
Holds value of property contact.
-
layer2Font
private Font layer2Font
Holds value of property layer2Font.
-
layer4Text
private java.lang.String layer4Text
Holds value of property layer4Text.
-
acro6Layers
private boolean acro6Layers
Holds value of property acro6Layers.
-
runDirection
private int runDirection
Holds value of property runDirection.
-
signatureEvent
private PdfSignatureAppearance.SignatureEvent signatureEvent
Holds value of property signatureEvent.
-
image
private Image image
Holds value of property image.
-
imageScale
private float imageScale
Holds value of property imageScale.
-
certificationLevel
private int certificationLevel
-
-
Constructor Detail
-
PdfSignatureAppearance
PdfSignatureAppearance(PdfStamperImp writer)
-
-
Method Detail
-
fitText
public static float fitText(Font font, java.lang.String text, Rectangle rect, float maxFontSize, int runDirection)
Fits the text to some rectangle adjusting the font size as needed.- Parameters:
font
- the font to usetext
- the textrect
- the rectangle where the text must fitmaxFontSize
- the maximum font sizerunDirection
- the run direction- Returns:
- the calculated font size that makes the text fit
-
getRender
public int getRender()
Gets the rendering mode for this signature.- Returns:
- the rendering mode for this signature
-
setRender
public void setRender(int render)
Sets the rendering mode for this signature. The rendering modes can be the constantsSignatureRenderDescription
,SignatureRenderNameAndDescription
orSignatureRenderGraphicAndDescription
. The two last modes should be used with Acrobat 6 layer type.- Parameters:
render
- the render mode
-
getSignatureGraphic
public Image getSignatureGraphic()
Gets the Image object to render.- Returns:
- the image
-
setSignatureGraphic
public void setSignatureGraphic(Image signatureGraphic)
Sets the Image object to render when Render is set toSignatureRenderGraphicAndDescription
- Parameters:
signatureGraphic
- image rendered. Ifnull
the mode is defaulted toSignatureRenderDescription
-
getLayer2Text
public java.lang.String getLayer2Text()
Gets the signature text identifying the signer if set by setLayer2Text().- Returns:
- the signature text identifying the signer
-
setLayer2Text
public void setLayer2Text(java.lang.String text)
Sets the signature text identifying the signer.- Parameters:
text
- the signature text identifying the signer. Ifnull
or not set a standard description will be used
-
getLayer4Text
public java.lang.String getLayer4Text()
Gets the text identifying the signature status if set by setLayer4Text().- Returns:
- the text identifying the signature status
-
setLayer4Text
public void setLayer4Text(java.lang.String text)
Sets the text identifying the signature status.- Parameters:
text
- the text identifying the signature status. Ifnull
or not set the description "Signature Not Verified" will be used
-
getRect
public Rectangle getRect()
Gets the rectangle representing the signature dimensions.- Returns:
- the rectangle representing the signature dimensions. It may be
null
or have zero width or height for invisible signatures
-
isInvisible
public boolean isInvisible()
Gets the visibility status of the signature.- Returns:
- the visibility status of the signature
-
setCrypto
public void setCrypto(java.security.PrivateKey privKey, java.security.cert.X509Certificate certificate, java.security.cert.CRL crl, PdfName filter)
Sets the cryptographic parameters.- Parameters:
privKey
- the private keycertificate
- the certificatecrl
- the certificate revocation list. It may benull
filter
- the cryptographic filter type. It can be SELF_SIGNED, VERISIGN_SIGNED or WINCER_SIGNED
-
setCrypto
public void setCrypto(java.security.PrivateKey privKey, java.security.cert.Certificate[] certChain, java.security.cert.CRL[] crlList, PdfName filter)
Sets the cryptographic parameters.- Parameters:
privKey
- the private keycertChain
- the certification chaincrlList
- the crl listfilter
- the PdfName
-
setVisibleSignature
public void setVisibleSignature(Rectangle pageRect, int page)
-
setVisibleSignature
public void setVisibleSignature(Rectangle pageRect, int page, java.lang.String fieldName)
Sets the signature to be visible. It creates a new visible signature field.- Parameters:
pageRect
- the position and dimension of the field in the pagepage
- the page to place the field. The fist page is 1fieldName
- the field name ornull
to generate automatically a new field name
-
setVisibleSignature
public void setVisibleSignature(java.lang.String fieldName)
Sets the signature to be visible. An empty signature field with the same name must already exist.- Parameters:
fieldName
- the existing empty signature field name
-
getLayer
public PdfTemplate getLayer(int layer)
Gets a template layer to create a signature appearance. The layers can go from 0 to 4.Consult PPKAppearances.pdf for further details.
- Parameters:
layer
- the layer- Returns:
- a template
-
getTopLayer
public PdfTemplate getTopLayer()
Gets the template that aggregates all appearance layers. This corresponds to the /FRM resource.Consult PPKAppearances.pdf for further details.
- Returns:
- the template that aggregates all appearance layers
-
getAppearance
public PdfTemplate getAppearance() throws DocumentException
Gets the main appearance layer.Consult PPKAppearances.pdf for further details.
- Returns:
- the main appearance layer
- Throws:
DocumentException
- on error
-
setExternalDigest
public void setExternalDigest(byte[] digest, byte[] RSAdata, java.lang.String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.- Parameters:
digest
- the digest. This is the actual signatureRSAdata
- the extra data that goes into the data tag in PKCS#7digestEncryptionAlgorithm
- the encryption algorithm. It may must benull
if thedigest
is alsonull
. If thedigest
is notnull
then it may be "RSA" or "DSA"
-
getReason
public java.lang.String getReason()
Gets the signing reason or null if not set.- Returns:
- the signing reason
-
setReason
public void setReason(java.lang.String reason)
Sets the signing reason.- Parameters:
reason
- the signing reason
-
getLocation
public java.lang.String getLocation()
Gets the signing location or null if not set.- Returns:
- the signing location
-
setLocation
public void setLocation(java.lang.String location)
Sets the signing location.- Parameters:
location
- the signing location
-
getProvider
public java.lang.String getProvider()
Returns the Cryptographic Service Provider that will sign the document. This method might return null if the provider was not set.- Returns:
- provider the name of the provider, for example "SUN", or
null
to use the default provider.
-
setProvider
public void setProvider(java.lang.String provider)
Sets the Cryptographic Service Provider that will sign the document.- Parameters:
provider
- the name of the provider, for example "SUN", ornull
to use the default provider.
-
getPrivKey
public java.security.PrivateKey getPrivKey()
Gets the private key.- Returns:
- the private key
-
getCrlList
public java.security.cert.CRL[] getCrlList()
Gets the certificate revocation list.- Returns:
- the certificate revocation list
-
getFilter
public PdfName getFilter()
Gets the filter used to sign the document.- Returns:
- the filter used to sign the document
-
isNewField
public boolean isNewField()
Checks if a new field was created.- Returns:
true
if a new field was created,false
if signing an existing field or if the signature is invisible
-
getPage
public int getPage()
Gets the page number of the field.- Returns:
- the page number of the field
-
getFieldName
public java.lang.String getFieldName()
Gets the field name.- Returns:
- the field name
-
setFieldNameForInvisibleSignatures
public void setFieldNameForInvisibleSignatures(java.lang.String fieldName)
Sets the field name for a new invisible signature field- Parameters:
fieldName
- for the new invisible signature field
-
getPageRect
public Rectangle getPageRect()
Gets the rectangle that represent the position and dimension of the signature in the page.- Returns:
- the rectangle that represent the position and dimension of the signature in the page
-
getSignDate
public java.util.Calendar getSignDate()
Gets the signature date.- Returns:
- the signature date
-
setSignDate
public void setSignDate(java.util.Calendar signDate)
Sets the signature date.- Parameters:
signDate
- the signature date
-
getSignDateNullSafe
public java.util.Calendar getSignDateNullSafe()
Gets the signature date. If the date is not set the current Date is returned.- Returns:
- the signature date
-
getSigout
ByteBuffer getSigout()
-
setSigout
void setSigout(ByteBuffer sigout)
-
getOriginalout
java.io.OutputStream getOriginalout()
-
setOriginalout
void setOriginalout(java.io.OutputStream originalout)
-
getTempFile
public java.io.File getTempFile()
Gets the temporary file.- Returns:
- the temporary file or
null
is the document is created in memory
-
setTempFile
void setTempFile(java.io.File tempFile)
-
getNewSigName
public final java.lang.String getNewSigName()
Gets a new signature fied name that doesn't clash with any existing name.- Returns:
- a new signature fied name
-
preClose
public void preClose() throws java.io.IOException, DocumentException
This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().If calling preClose() dont't call PdfStamper.close().
No external signatures are allowed if this method is called.
- Throws:
java.io.IOException
- on errorDocumentException
- on error
-
preClose
public void preClose(java.util.Map<PdfName,java.lang.Integer> exclusionSizes) throws java.io.IOException, DocumentException
This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().If calling preClose() dont't call PdfStamper.close().
If using an external signature
exclusionSizes
must contain at least thePdfName.CONTENTS
key with the size that it will take in the document. Note that due to the hex string coding this size should be byte_size*2+2.- Parameters:
exclusionSizes
- aHashMap
with names and sizes to be excluded in the signature calculation. The key is aPdfName
and the value anInteger
. At least thePdfName.CONTENTS
must be present- Throws:
java.io.IOException
- on errorDocumentException
- on error
-
close
public void close(PdfDictionary update) throws java.io.IOException, DocumentException
This is the last method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().update
is aPdfDictionary
that must have exactly the same keys as the ones provided inpreClose(Map)
.- Parameters:
update
- aPdfDictionary
with the key/value that will fill the holes defined inpreClose(Map)
- Throws:
DocumentException
- on errorjava.io.IOException
- on error
-
addDocMDP
private void addDocMDP(PdfDictionary crypto)
-
getRangeStream
public java.io.InputStream getRangeStream()
Gets the document bytes that are hashable when using external signatures. The general sequence is: preClose(), getRangeStream() and close().- Returns:
- the document bytes that are hashable
-
getCryptoDictionary
public PdfDictionary getCryptoDictionary()
Gets the user made signature dictionary. This is the dictionary at the /V key.- Returns:
- the user made signature dictionary
-
setCryptoDictionary
public void setCryptoDictionary(PdfDictionary cryptoDictionary)
Sets a user made signature dictionary. This is the dictionary at the /V key.- Parameters:
cryptoDictionary
- a user made signature dictionary
-
getStamper
public PdfStamper getStamper()
Gets thePdfStamper
associated with this instance.- Returns:
- the
PdfStamper
associated with this instance
-
setStamper
void setStamper(PdfStamper stamper)
-
isPreClosed
public boolean isPreClosed()
Checks if the document is in the process of closing.- Returns:
true
if the document is in the process of closing,false
otherwise
-
getSigStandard
public PdfSigGenericPKCS getSigStandard()
Gets the instance of the standard signature dictionary. This instance is only available after pre close.The main use is to insert external signatures.
- Returns:
- the instance of the standard signature dictionary
-
getContact
public java.lang.String getContact()
Gets the signing contact.- Returns:
- the signing contact
-
setContact
public void setContact(java.lang.String contact)
Sets the signing contact.- Parameters:
contact
- the signing contact
-
getLayer2Font
public Font getLayer2Font()
Gets the n2 and n4 layer font.- Returns:
- the n2 and n4 layer font
-
setLayer2Font
public void setLayer2Font(Font layer2Font)
Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used.- Parameters:
layer2Font
- the n2 and n4 font
-
isAcro6Layers
public boolean isAcro6Layers()
Gets the Acrobat 6.0 layer mode.- Returns:
- the Acrobat 6.0 layer mode
-
setAcro6Layers
public void setAcro6Layers(boolean acro6Layers)
Acrobat 6.0 and higher recommends that only layer n2 and n4 be present. This method sets that mode.- Parameters:
acro6Layers
- iftrue
only the layers n2 and n4 will be present
-
getRunDirection
public int getRunDirection()
Gets the run direction.- Returns:
- the run direction
-
setRunDirection
public void setRunDirection(int runDirection)
Sets the run direction in the n2 and n4 layer.- Parameters:
runDirection
- the run direction
-
getSignatureEvent
public PdfSignatureAppearance.SignatureEvent getSignatureEvent()
Getter for property signatureEvent.- Returns:
- Value of property signatureEvent.
-
setSignatureEvent
public void setSignatureEvent(PdfSignatureAppearance.SignatureEvent signatureEvent)
Sets the signature event to allow modification of the signature dictionary.- Parameters:
signatureEvent
- the signature event
-
getImage
public Image getImage()
Gets the background image for the layer 2.- Returns:
- the background image for the layer 2
-
setImage
public void setImage(Image image)
Sets the background image for the layer 2.- Parameters:
image
- the background image for the layer 2
-
getImageScale
public float getImageScale()
Gets the scaling to be applied to the background image.- Returns:
- the scaling to be applied to the background image
-
setImageScale
public void setImageScale(float imageScale)
Sets the scaling to be applied to the background image. If it's zero the image will fully fill the rectangle. If it's less than zero the image will fill the rectangle but will keep the proportions. If it's greater than zero that scaling will be applied. In any of the cases the image will always be centered. It's zero by default.- Parameters:
imageScale
- the scaling to be applied to the background image
-
getCertificationLevel
public int getCertificationLevel()
Gets the certified status of this document.- Returns:
- the certified status
-
setCertificationLevel
public void setCertificationLevel(int certificationLevel)
Sets the document type to certified instead of simply signed.- Parameters:
certificationLevel
- the values can be:NOT_CERTIFIED
,CERTIFIED_NO_CHANGES_ALLOWED
,CERTIFIED_FORM_FILLING
andCERTIFIED_FORM_FILLING_AND_ANNOTATIONS
-
-