Class SignatureImageParameters

java.lang.Object
eu.europa.esig.dss.pades.SignatureImageParameters
All Implemented Interfaces:
Serializable

public class SignatureImageParameters extends Object implements Serializable
Parameters for a visible signature creation
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor instantiating object with default parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns a specified background color for the signature field
    Returns a defined DPI value Note: can be null
    Returns SignatureFieldParameters
    eu.europa.esig.dss.model.DSSDocument
    Returns a DSSDocument image defined for displaying on the signature field
    eu.europa.esig.dss.enumerations.ImageScaling
    Gets the image scaling
    eu.europa.esig.dss.enumerations.VisualSignatureRotation
    Deprecated.
    since DSS 5.13.
    Returns text parameters
    eu.europa.esig.dss.enumerations.VisualSignatureAlignmentHorizontal
    Returns a horizontal alignment value of the signature field
    eu.europa.esig.dss.enumerations.VisualSignatureAlignmentVertical
    Returns a vertical alignment value of the signature field
    int
    Returns the defined Zoom value in percentage
    int
     
    boolean
    Checks if the SignatureImageParameters is empty (no image or text parameters are defined)
    void
    setAlignmentHorizontal(eu.europa.esig.dss.enumerations.VisualSignatureAlignmentHorizontal alignmentHorizontal)
    Sets a horizontal alignment respectively to a page of the signature field
    void
    setAlignmentVertical(eu.europa.esig.dss.enumerations.VisualSignatureAlignmentVertical alignmentVertical)
    Sets a vertical alignment respectively to a page of the signature field
    void
    setBackgroundColor(Color backgroundColor)
    Sets the background color for the signature field
    void
    Sets an expected DPI value.
    void
    Sets SignatureFieldParameters, like signature field position and dimensions
    void
    setImage(eu.europa.esig.dss.model.DSSDocument image)
    Allows to set a custom image to display on a signature field
    void
    setImageScaling(eu.europa.esig.dss.enumerations.ImageScaling imageScaling)
    Sets the parameter used to define an image scaling behavior within a signature field DEFAULT : ImageScaling.STRETCH (stretches the image in both directions in order to fill the signature field)
    void
    setRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation rotation)
    Deprecated.
    since DSS 5.13.
    void
    Sets text parameters
    void
    setZoom(int zoom)
    Defines the signature field zoom in percentage (default value = 100)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SignatureImageParameters

      public SignatureImageParameters()
      Default constructor instantiating object with default parameters
  • Method Details

    • getImage

      public eu.europa.esig.dss.model.DSSDocument getImage()
      Returns a DSSDocument image defined for displaying on the signature field
      Returns:
      DSSDocument image
    • setImage

      public void setImage(eu.europa.esig.dss.model.DSSDocument image)
      Allows to set a custom image to display on a signature field
      Parameters:
      image - DSSDocument
    • getFieldParameters

      public SignatureFieldParameters getFieldParameters()
      Returns SignatureFieldParameters
      Returns:
      SignatureFieldParameters
    • setFieldParameters

      public void setFieldParameters(SignatureFieldParameters fieldParameters)
      Sets SignatureFieldParameters, like signature field position and dimensions
      Parameters:
      fieldParameters - SignatureFieldParameters
    • getZoom

      public int getZoom()
      Returns the defined Zoom value in percentage
      Returns:
      int zoom
    • setZoom

      public void setZoom(int zoom)
      Defines the signature field zoom in percentage (default value = 100)
      Parameters:
      zoom - int zoom value
    • getBackgroundColor

      public Color getBackgroundColor()
      Returns a specified background color for the signature field
      Returns:
      Color background color
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
      Sets the background color for the signature field
      Parameters:
      backgroundColor - Color to set
    • getDpi

      public Integer getDpi()
      Returns a defined DPI value Note: can be null
      Returns:
      Integer dpi value
    • setDpi

      public void setDpi(Integer dpi)
      Sets an expected DPI value. If NULL the default dpi of the provided image is applied. Note: images with a lower DPI will take more space on a PDF page
      Parameters:
      dpi - Integer dpi value
    • getTextParameters

      public SignatureImageTextParameters getTextParameters()
      Returns text parameters
      Returns:
      SignatureImageTextParameters
    • setTextParameters

      public void setTextParameters(SignatureImageTextParameters textParameters)
      Sets text parameters
      Parameters:
      textParameters - SignatureImageTextParameters
    • getRotation

      @Deprecated public eu.europa.esig.dss.enumerations.VisualSignatureRotation getRotation()
      Deprecated.
      since DSS 5.13. Use #SignatureFieldParameters.getRotation()
      Returns rotation value for a signature field
      Returns:
      VisualSignatureRotation
    • setRotation

      @Deprecated public void setRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation rotation)
      Deprecated.
      since DSS 5.13. Use #SignatureFieldParameters.setRotation()
      Sets a rotation value for the signature field.
      Parameters:
      rotation - VisualSignatureRotation. The following values can be used: NONE (DEFAULT value. No rotation is applied. The origin of coordinates begins from the top left corner of a page); AUTOMATIC (Rotates a signature field respectively to the page's rotation. Rotates the signature field on the same value as a defined in a PDF page); ROTATE_90 (Rotates a signature field for a 90° clockwise. Coordinates' origin begins from top right page corner); ROTATE_180 (Rotates a signature field for a 180° clockwise. Coordinates' origin begins from the bottom right page corner); ROTATE_270 (Rotates a signature field for a 270° clockwise. Coordinates' origin begins from the bottom left page corner).
    • getVisualSignatureAlignmentHorizontal

      public eu.europa.esig.dss.enumerations.VisualSignatureAlignmentHorizontal getVisualSignatureAlignmentHorizontal()
      Returns a horizontal alignment value of the signature field
      Returns:
      VisualSignatureAlignmentHorizontal
    • setAlignmentHorizontal

      public void setAlignmentHorizontal(eu.europa.esig.dss.enumerations.VisualSignatureAlignmentHorizontal alignmentHorizontal)
      Sets a horizontal alignment respectively to a page of the signature field
      Parameters:
      alignmentHorizontal - VisualSignatureAlignmentHorizontal
    • getVisualSignatureAlignmentVertical

      public eu.europa.esig.dss.enumerations.VisualSignatureAlignmentVertical getVisualSignatureAlignmentVertical()
      Returns a vertical alignment value of the signature field
      Returns:
      VisualSignatureAlignmentVertical
    • setAlignmentVertical

      public void setAlignmentVertical(eu.europa.esig.dss.enumerations.VisualSignatureAlignmentVertical alignmentVertical)
      Sets a vertical alignment respectively to a page of the signature field
      Parameters:
      alignmentVertical - VisualSignatureAlignmentVertical
    • getImageScaling

      public eu.europa.esig.dss.enumerations.ImageScaling getImageScaling()
      Gets the image scaling
      Returns:
      ImageScaling
    • setImageScaling

      public void setImageScaling(eu.europa.esig.dss.enumerations.ImageScaling imageScaling)
      Sets the parameter used to define an image scaling behavior within a signature field DEFAULT : ImageScaling.STRETCH (stretches the image in both directions in order to fill the signature field)
      Parameters:
      imageScaling - ImageScaling
    • isEmpty

      public boolean isEmpty()
      Checks if the SignatureImageParameters is empty (no image or text parameters are defined)
      Returns:
      TRUE if the parameters are empty, FALSE otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object