Class DefaultImageDrawerUtils
java.lang.Object
eu.europa.esig.dss.pdf.pdfbox.visible.defaultdrawer.DefaultImageDrawerUtils
Contains the util methods used by the
eu.europa.esig.dss.pdf.pdfbox.visible.defaultdrawer.DefaultPdfBoxVisibleSignatureDrawer
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImage
createTextImage
(SignatureImageParameters imageParameters, SignatureFieldDimensionAndPosition dimensionAndPosition, JavaDSSFontMetrics fontMetrics) Creates an image representing the specified textstatic void
Sets the preferred image creation parameters to improve the renderingstatic BufferedImage
mergeImages
(BufferedImage image, BufferedImage textImage, SignatureFieldDimensionAndPosition dimensionAndPosition, SignatureImageParameters imageParameters) Creates the final image, by merging the givenimage
andtextImage
according to the provided parametersstatic BufferedImage
rotate
(BufferedImage image, double angle) Rotates the provided image to the givenangle
static BufferedImage
toBufferedImage
(DSSDocument imageDocument) Reads and converts the given image document to aBufferedImage
-
Method Details
-
createTextImage
public static BufferedImage createTextImage(SignatureImageParameters imageParameters, SignatureFieldDimensionAndPosition dimensionAndPosition, JavaDSSFontMetrics fontMetrics) Creates an image representing the specified text- Parameters:
imageParameters
-SignatureImageParameters
to usedimensionAndPosition
-SignatureFieldDimensionAndPosition
fontMetrics
-JavaDSSFontMetrics
- Returns:
BufferedImage
of the text picture
-
toBufferedImage
Reads and converts the given image document to aBufferedImage
- Parameters:
imageDocument
-BufferedImage
- Returns:
BufferedImage
-
initRendering
Sets the preferred image creation parameters to improve the rendering- Parameters:
g
-Graphics2D
to set
-
mergeImages
public static BufferedImage mergeImages(BufferedImage image, BufferedImage textImage, SignatureFieldDimensionAndPosition dimensionAndPosition, SignatureImageParameters imageParameters) Creates the final image, by merging the givenimage
andtextImage
according to the provided parameters- Parameters:
image
-BufferedImage
the image picturetextImage
-BufferedImage
the rasterized textdimensionAndPosition
-SignatureFieldDimensionAndPosition
imageParameters
-SignatureImageParameters
- Returns:
BufferedImage
-
rotate
Rotates the provided image to the givenangle
- Parameters:
image
-BufferedImage
to rotateangle
- the rotation angle- Returns:
- rotated
BufferedImage
-