public class SignatureAppearanceSetter
extends java.lang.Object
Constructor and Description |
---|
SignatureAppearanceSetter(com.itextpdf.text.pdf.PdfSignatureAppearance sap)
Creates a new signature appearance setter for the given signature appearance instance.
|
Modifier and Type | Method and Description |
---|---|
com.itextpdf.text.pdf.PdfTemplate |
getAppearance()
Gets the main appearance layer.
|
java.lang.String |
getFieldName()
Gets the field name.
|
com.itextpdf.text.Image |
getImage()
Gets the background image for the layer 2.
|
float |
getImageScale()
Gets the scaling to be applied to the background image.
|
com.itextpdf.text.pdf.PdfTemplate |
getLayer(int layer)
Gets a template layer to create a signature appearance.
|
com.itextpdf.text.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 |
getNewSigName()
Gets a new signature field name that doesn't clash with any existing name.
|
int |
getPage()
Gets the page number of the field.
|
com.itextpdf.text.Rectangle |
getPageRect()
Gets the rectangle that represent the position and dimension of the signature in the page.
|
com.itextpdf.text.Rectangle |
getRect()
Gets the rectangle representing the signature dimensions.
|
com.itextpdf.text.pdf.PdfSignatureAppearance.RenderingMode |
getRenderingMode()
Gets the rendering mode for this signature.
|
int |
getRunDirection()
Gets the run direction.
|
com.itextpdf.text.Image |
getSignatureGraphic()
Gets the Image object to render.
|
com.itextpdf.text.pdf.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.
|
void |
setAcro6Layers(boolean acro6Layers)
Acrobat 6.0 and higher recommends that only layer n0 and n2 be present.
|
void |
setImage(com.itextpdf.text.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(com.itextpdf.text.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 |
setRenderingMode(com.itextpdf.text.pdf.PdfSignatureAppearance.RenderingMode renderingMode)
Sets the rendering mode for this signature.
|
void |
setRunDirection(int runDirection)
Sets the run direction in the n2 and n4 layer.
|
void |
setSignatureGraphic(com.itextpdf.text.Image signatureGraphic)
Sets the Image object to render when Render is set to RenderingMode.GRAPHIC or
RenderingMode.GRAPHIC_AND_DESCRIPTION.
|
void |
setVisibleSignature(com.itextpdf.text.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.
|
public SignatureAppearanceSetter(com.itextpdf.text.pdf.PdfSignatureAppearance sap)
sap
- the iText signature appearance instancepublic java.lang.String getFieldName()
public java.lang.String getNewSigName()
public int getPage()
public com.itextpdf.text.Rectangle getRect()
public com.itextpdf.text.Rectangle getPageRect()
public boolean isInvisible()
public void setVisibleSignature(com.itextpdf.text.Rectangle pageRect, int page, java.lang.String fieldName)
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 or null to generate automatically a new field namepublic void setVisibleSignature(java.lang.String fieldName)
fieldName
- the existing empty signature field namepublic com.itextpdf.text.pdf.PdfSignatureAppearance.RenderingMode getRenderingMode()
public void setRenderingMode(com.itextpdf.text.pdf.PdfSignatureAppearance.RenderingMode renderingMode)
renderingMode
- the rendering modepublic com.itextpdf.text.Image getSignatureGraphic()
public void setSignatureGraphic(com.itextpdf.text.Image signatureGraphic)
signatureGraphic
- public boolean isAcro6Layers()
public void setAcro6Layers(boolean acro6Layers)
acro6Layers
- if true only the layers n0 and n2 will be presentpublic com.itextpdf.text.pdf.PdfTemplate getLayer(int layer)
layer
- the layerpublic com.itextpdf.text.Image getImage()
public void setImage(com.itextpdf.text.Image image)
image
- the background image for the layer 2public float getImageScale()
public void setImageScale(float imageScale)
imageScale
- the scaling to be applied to the background imagepublic void setLayer2Text(java.lang.String text)
text
- the signature text identifying the signer. If null or not set a standard description
will be usedpublic java.lang.String getLayer2Text()
public com.itextpdf.text.Font getLayer2Font()
public void setLayer2Font(com.itextpdf.text.Font layer2Font)
layer2Font
- the n2 and n4 fontpublic void setRunDirection(int runDirection)
runDirection
- the run directionpublic int getRunDirection()
public void setLayer4Text(java.lang.String text)
text
- the text identifying the signature status. If null or not set the description
"Signature Not Verified" will be usedpublic java.lang.String getLayer4Text()
public com.itextpdf.text.pdf.PdfTemplate getTopLayer()
public com.itextpdf.text.pdf.PdfTemplate getAppearance() throws com.itextpdf.text.DocumentException
com.itextpdf.text.DocumentException
- on error