com.crionics.jpdf.forms
Class SignatureAppearance

java.lang.Object
  extended by com.crionics.jpdf.forms.SignatureAppearance

public class SignatureAppearance
extends java.lang.Object

This object allows the visual customisation of Signature Form Fields. You can add a image (lineart of a signature for example) along a text specifying some information of regarding the Signature and the certificate used.


Field Summary
static int FIT_AREA
          Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should be resized to the dimension of this same bounding box.
static int FIT_KEEP_RATIO
          Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should be resized to the dimension of this same bounding box with the same X and Y ratio, to avoid image distortion.
static int FIT_NONE
          Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should not be resized to the dimension of this same bounding box.
static java.lang.String INFO_CONTACT_INFO
          Token specifying the "Contact Information" attribute present in the Certificate used to signed the Signature Form Field.
static java.lang.String INFO_DATE
          Token specifying the "Date" when the the Signature Form Field is actually signed.
static java.lang.String INFO_LOCATION
          Token specifying the "Location" attribute present in the Certificate used to signed the Signature Form Field.
static java.lang.String INFO_REASON
          Token specifying the "Reason" attribute present in the Certificate used to signed the Signature Form Field.
static java.lang.String INFO_SIGNER_NAME
          Token specifying the "Signer Name" attribute present in the Certificate used to signed the Signature Form Field.
 
Constructor Summary
SignatureAppearance()
          Constructs a new Signature Appearance Object with all its fields set to their default values.
 
Method Summary
 int getFitMode()
          Returns the fitting mode which will be used to add the image (setImage(AbstractImage, int)) as the Signature visual appearance.
 AbstractImage getImage()
          Returns the Image which will be added to the Signature visual appearance.
 java.lang.String getSignatureInfoContent()
          Returns the string set to construct the Signature Information visual appearance ( setSignatureInfoContent(String, Rectangle)).
 java.awt.Rectangle getSignatureInfoPosition()
          Returns the position of the the Signature Information visual appearance.
 boolean isShowingSignatureInfo()
          Queries if the Signature will contains Visual Information.
 void setImage(AbstractImage image, int fitMode)
          Specifies the Image to be drawn on the Signature Form Field bounding box, and the Fitting mode to use.
 void setSignatureInfoContent(java.lang.String signatureInfoContent, java.awt.Rectangle positionSignatureInfo)
          Specifies the Information to be drawn on the Signature Form Field Box (above the image if present).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIT_AREA

public static int FIT_AREA
Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should be resized to the dimension of this same bounding box.


FIT_KEEP_RATIO

public static int FIT_KEEP_RATIO
Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should be resized to the dimension of this same bounding box with the same X and Y ratio, to avoid image distortion.


FIT_NONE

public static int FIT_NONE
Flag used to specify that the Image to be drawn in the Signature Form Field Bounding box, should not be resized to the dimension of this same bounding box.


INFO_CONTACT_INFO

public static java.lang.String INFO_CONTACT_INFO
Token specifying the "Contact Information" attribute present in the Certificate used to signed the Signature Form Field.


INFO_DATE

public static java.lang.String INFO_DATE
Token specifying the "Date" when the the Signature Form Field is actually signed.


INFO_LOCATION

public static java.lang.String INFO_LOCATION
Token specifying the "Location" attribute present in the Certificate used to signed the Signature Form Field.


INFO_REASON

public static java.lang.String INFO_REASON
Token specifying the "Reason" attribute present in the Certificate used to signed the Signature Form Field.


INFO_SIGNER_NAME

public static java.lang.String INFO_SIGNER_NAME
Token specifying the "Signer Name" attribute present in the Certificate used to signed the Signature Form Field.

Constructor Detail

SignatureAppearance

public SignatureAppearance()
Constructs a new Signature Appearance Object with all its fields set to their default values.

Method Detail

getFitMode

public int getFitMode()
Returns the fitting mode which will be used to add the image (setImage(AbstractImage, int)) as the Signature visual appearance.

Returns:
One of the constant FIT_xxx

getImage

public AbstractImage getImage()
Returns the Image which will be added to the Signature visual appearance.

Returns:
The image or null if none were set.

getSignatureInfoContent

public java.lang.String getSignatureInfoContent()
Returns the string set to construct the Signature Information visual appearance ( setSignatureInfoContent(String, Rectangle)).

Returns:
the Signature Information String or null if none were specified.

getSignatureInfoPosition

public java.awt.Rectangle getSignatureInfoPosition()
Returns the position of the the Signature Information visual appearance.

Returns:
the position or null if either the position is to be determined automatically by the API or if no Information is to be drawn within the Signature Form Field box.

isShowingSignatureInfo

public boolean isShowingSignatureInfo()
Queries if the Signature will contains Visual Information.

Returns:
true if it is the case, false otherwise.

setImage

public void setImage(AbstractImage image,
                     int fitMode)
Specifies the Image to be drawn on the Signature Form Field bounding box, and the Fitting mode to use.

Parameters:
image - The image to be drawn.
Default value:
null
fitMode - The fitting mode to be used with the image regarding the bounding box of the Signature Field.
Default value:
FIT_KEEP_RATIO

setSignatureInfoContent

public void setSignatureInfoContent(java.lang.String signatureInfoContent,
                                    java.awt.Rectangle positionSignatureInfo)
Specifies the Information to be drawn on the Signature Form Field Box (above the image if present).

Parameters:
signatureInfoContent - A String object specifying the text to be drawn or null if no information is to be drawn. If the string contains any of the pre-defined tokens (INFO_XXX), the API will automatically update theses token with the corresponding value stored in the certificat used to sign the Form Field.
Default value:
"Digitaly signed by " +INFO_SIGNER_NAME+ "\n" +
"Location: " +INFO_LOCATION+ "\n" +
"Contact Info: " +INFO_CONTACT_INFO+ "\n" +
"Reason: " +INFO_REASON+ "\n" +
"Date: " +INFO_DATE
positionSignatureInfo - The rectangle specifying the position of the Information Content within the Signature Bounding Box (@see AbstractField#getPosition()). The coordinate 0,0 correspond to the top left corner. If this entry is null the Information Content position will be set to a default value.
Default value:
null


Copyright © 1999-2007 Crionics. All Rights Reserved.