Package eu.europa.esig.dss.pades
Class SignatureImageParameters
- java.lang.Object
-
- eu.europa.esig.dss.pades.SignatureImageParameters
-
public class SignatureImageParameters extends Object
Parameters for a visible signature creation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSignatureImageParameters.VisualSignatureAlignmentHorizontalVisual signature horizontal position on the pdf pagestatic classSignatureImageParameters.VisualSignatureAlignmentVerticalVisual signature vertical position on the pdf pagestatic classSignatureImageParameters.VisualSignatureRotationRotation support
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PAGEstatic intNO_SCALING
-
Constructor Summary
Constructors Constructor Description SignatureImageParameters()
-
Method Summary
Modifier and Type Method Description ColorgetBackgroundColor()Returns a specified background color for the signature fieldIntegergetDpi()Returns a defined DPI value Note: can be nullintgetHeight()Returns a specified height of the signature fieldDSSDocumentgetImage()Returns aDSSDocumentimage defined for displaying on the signature fieldintgetPage()Returns a page number where the signature field must be placedSignatureImageParameters.VisualSignatureRotationgetRotation()Returns rotation value for a signature fieldfloatgetScaleFactor()Returns a coefficient applying to a signature field width/height calculationSignatureImageTextParametersgetTextParameters()Returns text parametersSignatureImageParameters.VisualSignatureAlignmentHorizontalgetVisualSignatureAlignmentHorizontal()Returns a horizontal alignment value of the signature fieldSignatureImageParameters.VisualSignatureAlignmentVerticalgetVisualSignatureAlignmentVertical()Returns a vertical alignment value of the signature fieldintgetWidth()Returns a specified width of the signature fieldfloatgetxAxis()Returns an absolute margin of the signature field by X axisfloatgetyAxis()Returns an absolute margin of the signature field by Y axisintgetZoom()Returns the defined Zoom value in percentagevoidsetAlignmentHorizontal(SignatureImageParameters.VisualSignatureAlignmentHorizontal alignmentHorizontal)Sets a horizontal alignment respectively to a page of the signature fieldvoidsetAlignmentVertical(SignatureImageParameters.VisualSignatureAlignmentVertical alignmentVertical)Sets a vertical alignment respectively to a page of the signature fieldvoidsetBackgroundColor(Color backgroundColor)Sets the background color for the signature fieldvoidsetDpi(Integer dpi)Sets an expected DPI value.voidsetHeight(int height)Defines a custom height for the signature field in pixelsvoidsetImage(DSSDocument image)Allows to set a custom image to display on a signature fieldvoidsetPage(int page)Defines a number of page in the document where the signature field must be placed.voidsetRotation(SignatureImageParameters.VisualSignatureRotation rotation)Sets a rotation value for the signature field.voidsetTextParameters(SignatureImageTextParameters textParameters)Sets text parametersvoidsetWidth(int width)Defines a custom width for the signature field in pixelsvoidsetxAxis(float xAxis)Allows specifying of an absolute margin for the signature field by X axisvoidsetyAxis(float yAxis)Allows specifying of an absolute margin for the signature field by Y axisvoidsetZoom(int zoom)Defines the signature field zoom in percentage (default value = 100)
-
-
-
Field Detail
-
DEFAULT_PAGE
public static final int DEFAULT_PAGE
- See Also:
- Constant Field Values
-
NO_SCALING
public static final int NO_SCALING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getImage
public DSSDocument getImage()
Returns aDSSDocumentimage defined for displaying on the signature field- Returns:
DSSDocumentimage
-
setImage
public void setImage(DSSDocument image)
Allows to set a custom image to display on a signature field- Parameters:
image-DSSDocument
-
getxAxis
public float getxAxis()
Returns an absolute margin of the signature field by X axis- Returns:
- X axis float value
-
setxAxis
public void setxAxis(float xAxis)
Allows specifying of an absolute margin for the signature field by X axis- Parameters:
xAxis-floatmargin
-
getyAxis
public float getyAxis()
Returns an absolute margin of the signature field by Y axis- Returns:
- Y axis float value
-
setyAxis
public void setyAxis(float yAxis)
Allows specifying of an absolute margin for the signature field by Y axis- Parameters:
yAxis-floatmargin
-
getZoom
public int getZoom()
Returns the defined Zoom value in percentage- Returns:
intzoom
-
setZoom
public void setZoom(int zoom)
Defines the signature field zoom in percentage (default value = 100)- Parameters:
zoom-intzoom value
-
getScaleFactor
public float getScaleFactor()
Returns a coefficient applying to a signature field width/height calculation- Returns:
floatscale factor
-
getPage
public int getPage()
Returns a page number where the signature field must be placed- Returns:
intpage number
-
setPage
public void setPage(int page)
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!- Parameters:
page-intpage number
-
getWidth
public int getWidth()
Returns a specified width of the signature field- Returns:
intwidth value
-
setWidth
public void setWidth(int width)
Defines a custom width for the signature field in pixels- Parameters:
width-intwidth value
-
getHeight
public int getHeight()
Returns a specified height of the signature field- Returns:
intheight value
-
setHeight
public void setHeight(int height)
Defines a custom height for the signature field in pixels- Parameters:
height-intheight value
-
getBackgroundColor
public Color getBackgroundColor()
Returns a specified background color for the signature field- Returns:
Colorbackground color
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
Sets the background color for the signature field- Parameters:
backgroundColor-Colorto set
-
getDpi
public Integer getDpi()
Returns a defined DPI value Note: can be null- Returns:
Integerdpi 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-Integerdpi value
-
getTextParameters
public SignatureImageTextParameters getTextParameters()
Returns text parameters- Returns:
SignatureImageTextParameters
-
setTextParameters
public void setTextParameters(SignatureImageTextParameters textParameters)
Sets text parameters- Parameters:
textParameters-SignatureImageTextParameters
-
getRotation
public SignatureImageParameters.VisualSignatureRotation getRotation()
Returns rotation value for a signature field
-
setRotation
public void setRotation(SignatureImageParameters.VisualSignatureRotation rotation)
Sets a rotation value for the signature field.- Parameters:
rotation-SignatureImageParameters.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 SignatureImageParameters.VisualSignatureAlignmentHorizontal getVisualSignatureAlignmentHorizontal()
Returns a horizontal alignment value of the signature field
-
setAlignmentHorizontal
public void setAlignmentHorizontal(SignatureImageParameters.VisualSignatureAlignmentHorizontal alignmentHorizontal)
Sets a horizontal alignment respectively to a page of the signature field- Parameters:
alignmentHorizontal-SignatureImageParameters.VisualSignatureAlignmentHorizontal
-
getVisualSignatureAlignmentVertical
public SignatureImageParameters.VisualSignatureAlignmentVertical getVisualSignatureAlignmentVertical()
Returns a vertical alignment value of the signature field
-
setAlignmentVertical
public void setAlignmentVertical(SignatureImageParameters.VisualSignatureAlignmentVertical alignmentVertical)
Sets a vertical alignment respectively to a page of the signature field- Parameters:
alignmentVertical-SignatureImageParameters.VisualSignatureAlignmentVertical
-
-