|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.qoppa.pdf.SignatureAppearance
public class SignatureAppearance
This class provides functionality to customize the appearance of a visible signature when a document is signed. The default signature appearance uses the distinguished name properties of the signing certificate and displays it as:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Digitally signed by \ \ Your Name \ \ Your common name, org unit\ \ Name org name, locality \ \ state, country, email\ \ Date \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Each of these attributes can be visible or hidden. See
setVisibleName(boolean), setVisibleCommonName(boolean),
setVisibleOrgUnit(boolean), setVisibleOrgName(boolean),
setVisibleLocal(boolean), setVisibleState(boolean),
setVisibleCountry(boolean), setVisibleEmail(boolean), setVisibleDate(boolean)
. The orientation can also be reversed with setTextOrientation(int).
Custom text content can also be used instead of the distinguished name of the
signing certificate. See setTextLeft(java.lang.String), setTextRight(java.lang.String)
Additionally, an image can be used to create the signature appearance
setImage(java.awt.image.BufferedImage). The image can be placed in the center, left or right side
of the field with setImagePosition(int).
| Constructor Summary | |
|---|---|
SignatureAppearance()
Default constructor |
|
SignatureAppearance(String xmlString)
This constructor creates a SignatureAppearance from a
properly formatted XML string. |
|
| Method Summary | |
|---|---|
String |
getDisplayName()
This name is not used to generate the appearance stream. |
long |
getID()
This unique identifier is not used to generate the appearance stream. |
BufferedImage |
getImage()
Returns the buffered image to use when creating the signature appearance. |
int |
getImagePosition()
Returns the horizontal position of the image. |
float |
getImageTransparency()
Returns the image transparency value to use when drawing the image on the SignatureField. |
String |
getTextLeft()
Returns the text to display on the left side of the signature appearance. |
int |
getTextOrientation()
Returns the orientation of the text. |
String |
getTextRight()
Returns the text to display on the right side of the signature appearance. |
boolean |
isVisibleCommonName()
Returns whether or not the common name should be used when creating the signature appearance. |
boolean |
isVisibleCountry()
Returns whether or not the country should be used when creating the signature appearance. |
boolean |
isVisibleDate()
Returns whether or not the date should be used when creating the signature appearance. |
boolean |
isVisibleDigitallySigned()
Returns whether or not the "Digitally signed by..." label should be used when creating the signature appearance. |
boolean |
isVisibleEmail()
Returns whether or not the email address should be used when creating the signature appearance. |
boolean |
isVisibleLocal()
Returns whether or not the locality should be used when creating the signature appearance. |
boolean |
isVisibleName()
Returns whether or not the name should be used when creating the signature appearance. |
boolean |
isVisibleOrgName()
Returns whether or not the organization name should be used when creating the signature appearance. |
boolean |
isVisibleOrgUnit()
Returns whether or not the organizational unit should be used when creating the signature appearance. |
boolean |
isVisibleState()
Returns whether or not the state should be used when creating the signature appearance. |
void |
setDisplayName(String displayName)
This name is not used to generate the appearance stream. |
void |
setImage(BufferedImage bufferedImage)
Sets a buffered image to use then creating the signature appearance. |
void |
setImageFile(String fileName)
If the image file name is set, this SignatureAppearance will attempt to load
a BufferedImage from the file. |
void |
setImagePosition(int imagePosition)
Sets the horizontal position of the image. |
void |
setImageTransparency(float alpha)
Sets the image transparency value to use when drawing the image on the SignatureField. |
void |
setTextLeft(String text)
Sets the left text property to use when creating the signature appearance. |
void |
setTextOrientation(int orientation)
Sets the orientation of the text. |
void |
setTextRight(String text)
Sets the right text property to use when creating the signature appearance. |
void |
setVisibleCommonName(boolean visible)
If the distinguished name of the signing certificate contains a common name, this sets whether or not the common name should be used when creating the signature appearance. |
void |
setVisibleCountry(boolean visible)
If the distinguished name of the signing certificate contains a country code, this sets whether or not the country code should be used when creating the signature appearance. |
void |
setVisibleDate(boolean visible)
This sets whether or not the date should be used when creating the signature appearance. |
void |
setVisibleDigitallySigned(boolean visible)
Sets whether or not the "Digitally signed by..." label should be used when creating the signature appearance. |
void |
setVisibleEmail(boolean visible)
If the distinguished name of the signing certificate contains an email address, this sets whether or not the email address should be used when creating the signature appearance. |
void |
setVisibleLocal(boolean visible)
If the distinguished name of the signing certificate contains a locality, this sets whether or not the locality should be used when creating the signature appearance. |
void |
setVisibleName(boolean visible)
If the distinguished name of the signing certificate contains a common name, this sets whether or not the name should be used when creating the signature appearance. |
void |
setVisibleOrgName(boolean visible)
If the distinguished name of the signing certificate contains an organization name, this sets whether or not the organization name should be used when creating the signature appearance. |
void |
setVisibleOrgUnit(boolean visible)
If the distinguished name of the signing certificate contains an organizational unit, this sets whether or not the organizational unit should be used when creating the signature appearance. |
void |
setVisibleState(boolean visible)
If the distinguished name of the signing certificate contains a state, this sets whether or not the state should be used when creating the signature appearance. |
void |
showCertificateDN(boolean visible)
This is a convenience method set the visibility of all of the distinguished name properties of the signing certificate. |
String |
toString()
|
String |
toXMLString()
This method creates a String that contains an XML element of
the Tool default properties. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SignatureAppearance()
public SignatureAppearance(String xmlString)
SignatureAppearance from a
properly formatted XML string.
xmlString - toXMLString()| Method Detail |
|---|
public void showCertificateDN(boolean visible)
visible - setVisibleCommonName(boolean),
setVisibleCountry(boolean),
setVisibleEmail(boolean),
setVisibleLocal(boolean),
setVisibleOrgName(boolean),
setVisibleOrgUnit(boolean),
setVisibleState(boolean)public boolean isVisibleName()
public void setVisibleName(boolean visible)
visible - flag indicating if the name should be visiblepublic boolean isVisibleDigitallySigned()
public void setVisibleDigitallySigned(boolean visible)
visible - flag indicating if the "Digitally signed by..." label should
be visiblepublic boolean isVisibleCommonName()
public void setVisibleCommonName(boolean visible)
visible - flag indicating if the common name should be visiblepublic boolean isVisibleOrgUnit()
public void setVisibleOrgUnit(boolean visible)
visible - flag indicating if the organizational unit should be visiblepublic boolean isVisibleOrgName()
public void setVisibleOrgName(boolean visible)
visible - flag indicating if the organization name should be visiblepublic boolean isVisibleLocal()
public void setVisibleLocal(boolean visible)
visible - flag indicating if the locality should be visiblepublic boolean isVisibleState()
public void setVisibleState(boolean visible)
visible - flag indicating if the state should be visiblepublic boolean isVisibleCountry()
public void setVisibleCountry(boolean visible)
visible - flag indicating if the country code should be visiblepublic boolean isVisibleEmail()
public void setVisibleEmail(boolean visible)
visible - flag indicating if the email address should be visiblepublic boolean isVisibleDate()
public void setVisibleDate(boolean visible)
visible - flag indicating if the date should be visible
public BufferedImage getImage()
throws IOException
setImageFile(String) and the
BufferedImage is null, this method will attempt
to read the a BufferedImage from the image file name.
IOExceptionpublic void setImage(BufferedImage bufferedImage)
bufferedImage - the buffered image to use when creating the signature
appearancepublic float getImageTransparency()
SignatureField.
public void setImageTransparency(float alpha)
SignatureField. The value must be between 0.0 and 1.0
inclusive.
alpha - the image transparency to set
IllegalArgumentExceptionpublic int getImagePosition()
SwingConstants: LEFT,
CENTER, RIGHT, LEADING or
TRAILING.SwingConstantspublic void setImagePosition(int imagePosition)
imagePosition - One of the following constants defined in
SwingConstants: LEFT,
CENTER (the default), RIGHT,
LEADING, or TRAILING.public String getTextLeft()
public void setTextLeft(String text)
text - the text on the left side of the signature fieldpublic String getTextRight()
public void setTextRight(String text)
text - the text on the right side of the signature fieldpublic void setTextOrientation(int orientation)
orientation - One of the following constants defined in
SwingConstants: LEFT,
RIGHT, LEADING (the default) or
TRAILING.public int getTextOrientation()
SwingConstants:
LEFT, RIGHT, LEADING or
TRAILING.setTextOrientation(int),
SwingConstantspublic void setImageFile(String fileName)
SignatureAppearance will attempt to load
a BufferedImage from the file.
fileName - public long getID()
SignatureAppearance as an XML string, or when
creating a SignatureAppearance from an XML string.
toXMLString(),
SignatureAppearance(String)public void setDisplayName(String displayName)
SignatureAppearance. It is also used in
saving the SignatureAppearance as an XML string, or when
creating a SignatureAppearance from an XML string.
displayName - the displayName to settoXMLString(),
SignatureAppearance(String)public String getDisplayName()
SignatureAppearance. It is also used in
saving the SignatureAppearance as an XML string, or when
creating a SignatureAppearance from an XML string.
toXMLString(),
SignatureAppearance(String)public String toString()
toString in class Objectpublic String toXMLString()
String that contains an XML element of
the Tool default properties. This String can be stored and
used to set the SignatureAppearance.
String containing an XML element of the
SignatureAppearance propertiesSignatureAppearance(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||