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:
Serialized Form
  • Constructor Details

    • SignatureImageParameters

      public SignatureImageParameters()
  • Method Details

    • getImage

      public DSSDocument getImage()
      Returns a DSSDocument image defined for displaying on the signature field
      Returns:
      DSSDocument image
    • setImage

      public void setImage​(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
    • setxAxis

      @Deprecated public void setxAxis​(float originX)
      Deprecated.
      Allows specifying of an absolute margin for the signature field by X axis Deprecated. Use getFieldParameters().setOriginX(originX) method
      Parameters:
      originX - float margin
    • setyAxis

      @Deprecated public void setyAxis​(float originY)
      Deprecated.
      Allows specifying of an absolute margin for the signature field by Y axis Deprecated. Use getFieldParameters().setOriginY(originY) method
      Parameters:
      originY - float margin
    • setPage

      @Deprecated public void setPage​(int page)
      Deprecated.
      Defines a number of page in the document where the signature field must be placed. The counting of pages starts from 1 (the first page) (default value = 1) NOTE: the page must exist in the document! Deprecated. Use getFieldParameters().setPage(page) method
      Parameters:
      page - int page number
    • setWidth

      @Deprecated public void setWidth​(int width)
      Deprecated.
      Defines a custom width for the signature field in pixels Deprecated. Use getFieldParameters().setWidth(width) method
      Parameters:
      width - int width value
    • setHeight

      @Deprecated public void setHeight​(int height)
      Deprecated.
      Defines a custom height for the signature field in pixels Deprecated. Use getFieldParameters().setHeight(height) method
      Parameters:
      height - int height value
    • 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

      public VisualSignatureRotation getRotation()
      Returns rotation value for a signature field
      Returns:
      VisualSignatureRotation
    • setRotation

      public void setRotation​(VisualSignatureRotation rotation)
      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 VisualSignatureAlignmentHorizontal getVisualSignatureAlignmentHorizontal()
      Returns a horizontal alignment value of the signature field
      Returns:
      VisualSignatureAlignmentHorizontal
    • setAlignmentHorizontal

      public void setAlignmentHorizontal​(VisualSignatureAlignmentHorizontal alignmentHorizontal)
      Sets a horizontal alignment respectively to a page of the signature field
      Parameters:
      alignmentHorizontal - VisualSignatureAlignmentHorizontal
    • getVisualSignatureAlignmentVertical

      public VisualSignatureAlignmentVertical getVisualSignatureAlignmentVertical()
      Returns a vertical alignment value of the signature field
      Returns:
      VisualSignatureAlignmentVertical
    • setAlignmentVertical

      public void setAlignmentVertical​(VisualSignatureAlignmentVertical alignmentVertical)
      Sets a vertical alignment respectively to a page of the signature field
      Parameters:
      alignmentVertical - VisualSignatureAlignmentVertical
    • 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