Save This Page
Home » iText-2.1.7 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
public class: PdfSignatureAppearance [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.PdfSignatureAppearance
This class takes care of the cryptographic options and appearances that form a signature.
Nested Class Summary:
public interface  PdfSignatureAppearance.SignatureEvent  An interface to retrieve the signature dictionary for modification. 
Field Summary
public static final  int SignatureRenderDescription    The rendering mode is just the description 
public static final  int SignatureRenderNameAndDescription    The rendering mode is the name of the signer and the description 
public static final  int SignatureRenderGraphicAndDescription    The rendering mode is an image and the description 
public static final  PdfName SELF_SIGNED    The self signed filter. 
public static final  PdfName VERISIGN_SIGNED    The VeriSign filter. 
public static final  PdfName WINCER_SIGNED    The Windows Certificate Security. 
public static final  int NOT_CERTIFIED     
public static final  int CERTIFIED_NO_CHANGES_ALLOWED     
public static final  int CERTIFIED_FORM_FILLING     
public static final  int CERTIFIED_FORM_FILLING_AND_ANNOTATIONS     
public static final  String questionMark    Commands to draw a yellow question mark in a stream content 
Constructor:
 PdfSignatureAppearance(PdfStamperImp writer) 
Method from com.lowagie.text.pdf.PdfSignatureAppearance Summary:
close,   fitText,   getAppearance,   getCertChain,   getCertificationLevel,   getContact,   getCrlList,   getCryptoDictionary,   getFieldName,   getFilter,   getImage,   getImageScale,   getLayer,   getLayer2Font,   getLayer2Text,   getLayer4Text,   getLocation,   getNewSigName,   getOriginalout,   getPage,   getPageRect,   getPrivKey,   getProvider,   getRangeStream,   getReason,   getRect,   getRender,   getRunDirection,   getSigStandard,   getSignDate,   getSignatureEvent,   getSignatureGraphic,   getSigout,   getStamper,   getTempFile,   getTopLayer,   isAcro6Layers,   isInvisible,   isNewField,   isPreClosed,   preClose,   preClose,   setAcro6Layers,   setCertificationLevel,   setContact,   setCrypto,   setCryptoDictionary,   setExternalDigest,   setImage,   setImageScale,   setLayer2Font,   setLayer2Text,   setLayer4Text,   setLocation,   setOriginalout,   setProvider,   setReason,   setRender,   setRunDirection,   setSignDate,   setSignatureEvent,   setSignatureGraphic,   setSigout,   setStamper,   setTempFile,   setVisibleSignature,   setVisibleSignature
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.PdfSignatureAppearance Detail:
 public  void close(PdfDictionary update) throws IOException, DocumentException 
    This is the last method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().

    update is a PdfDictionary that must have exactly the same keys as the ones provided in #preClose(HashMap) .

 public static float fitText(Font font,
    String text,
    Rectangle rect,
    float maxFontSize,
    int runDirection) 
    Fits the text to some rectangle adjusting the font size as needed.
 public PdfTemplate getAppearance() throws DocumentException 
 public Certificate[] getCertChain() 
    Gets the certificate chain.
 public int getCertificationLevel() 
    Gets the certified status of this document.
 public String getContact() 
    Gets the signing contact.
 public CRL[] getCrlList() 
    Gets the certificate revocation list.
 public PdfDictionary getCryptoDictionary() 
    Gets the user made signature dictionary. This is the dictionary at the /V key.
 public String getFieldName() 
    Gets the field name.
 public PdfName getFilter() 
    Gets the filter used to sign the document.
 public Image getImage() 
    Gets the background image for the layer 2.
 public float getImageScale() 
    Gets the scaling to be applied to the background image.
 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.

 public Font getLayer2Font() 
    Gets the n2 and n4 layer font.
 public String getLayer2Text() 
    Gets the signature text identifying the signer if set by setLayer2Text().
 public String getLayer4Text() 
    Gets the text identifying the signature status if set by setLayer4Text().
 public String getLocation() 
    Gets the signing location.
 public String getNewSigName() 
    Gets a new signature fied name that doesn't clash with any existing name.
 OutputStream getOriginalout() 
 public int getPage() 
    Gets the page number of the field.
 public Rectangle getPageRect() 
    Gets the rectangle that represent the position and dimension of the signature in the page.
 public PrivateKey getPrivKey() 
    Gets the private key.
 public String getProvider() 
    Returns the Cryptographic Service Provider that will sign the document.
 public InputStream getRangeStream() 
    Gets the document bytes that are hashable when using external signatures. The general sequence is: preClose(), getRangeStream() and close().

 public String getReason() 
    Gets the signing reason.
 public Rectangle getRect() 
    Gets the rectangle representing the signature dimensions.
 public int getRender() 
    Gets the rendering mode for this signature.
 public int getRunDirection() 
    Gets the run direction.
 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.

 public Calendar getSignDate() 
    Gets the signature date.
 public SignatureEvent getSignatureEvent() 
    Getter for property signatureEvent.
 public Image getSignatureGraphic() 
    Gets the Image object to render.
 ByteBuffer getSigout() 
 public PdfStamper getStamper() 
    Gets the PdfStamper associated with this instance.
 public File getTempFile() 
    Gets the temporary file.
 public PdfTemplate getTopLayer() 
    Gets the template that aggregates all appearance layers. This corresponds to the /FRM resource.

    Consult PPKAppearances.pdf for further details.

 public boolean isAcro6Layers() 
    Gets the Acrobat 6.0 layer mode.
 public boolean isInvisible() 
    Gets the visibility status of the signature.
 public boolean isNewField() 
    Checks if a new field was created.
 public boolean isPreClosed() 
    Checks if the document is in the process of closing.
 public  void preClose() throws 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.

 public  void preClose(HashMap exclusionSizes) throws 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 the PdfName.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.

 public  void setAcro6Layers(boolean acro6Layers) 
    Acrobat 6.0 and higher recommends that only layer n2 and n4 be present. This method sets that mode.
 public  void setCertificationLevel(int certificationLevel) 
    Sets the document type to certified instead of simply signed.
 public  void setContact(String contact) 
    Sets the signing contact.
 public  void setCrypto(PrivateKey privKey,
    Certificate[] certChain,
    CRL[] crlList,
    PdfName filter) 
    Sets the cryptographic parameters.
 public  void setCryptoDictionary(PdfDictionary cryptoDictionary) 
    Sets a user made signature dictionary. This is the dictionary at the /V key.
 public  void setExternalDigest(byte[] digest,
    byte[] RSAdata,
    String digestEncryptionAlgorithm) 
    Sets the digest/signature to an external calculated value.
 public  void setImage(Image image) 
    Sets the background image for the layer 2.
 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.
 public  void setLayer2Font(Font layer2Font) 
    Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used.
 public  void setLayer2Text(String text) 
    Sets the signature text identifying the signer.
 public  void setLayer4Text(String text) 
    Sets the text identifying the signature status.
 public  void setLocation(String location) 
    Sets the signing location.
  void setOriginalout(OutputStream originalout) 
 public  void setProvider(String provider) 
    Sets the Cryptographic Service Provider that will sign the document.
 public  void setReason(String reason) 
    Sets the signing reason.
 public  void setRender(int render) 
    Sets the rendering mode for this signature. The rendering modes can be the constants SignatureRenderDescription, SignatureRenderNameAndDescription or SignatureRenderGraphicAndDescription. The two last modes should be used with Acrobat 6 layer type.
 public  void setRunDirection(int runDirection) 
    Sets the run direction in the n2 and n4 layer.
 public  void setSignDate(Calendar signDate) 
    Sets the signature date.
 public  void setSignatureEvent(SignatureEvent signatureEvent) 
    Sets the signature event to allow modification of the signature dictionary.
 public  void setSignatureGraphic(Image signatureGraphic) 
    Sets the Image object to render when Render is set to SignatureRenderGraphicAndDescription
  void setSigout(ByteBuffer sigout) 
  void setStamper(PdfStamper stamper) 
  void setTempFile(File tempFile) 
 public  void setVisibleSignature(String fieldName) 
    Sets the signature to be visible. An empty signature field with the same name must already exist.
 public  void setVisibleSignature(Rectangle pageRect,
    int page,
    String fieldName) 
    Sets the signature to be visible. It creates a new visible signature field.