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 BufferedImagecreateTextImage(SignatureImageParameters imageParameters, SignatureFieldDimensionAndPosition dimensionAndPosition, JavaDSSFontMetrics fontMetrics) Creates an image representing the specified textstatic voidSets the preferred image creation parameters to improve the renderingstatic BufferedImagemergeImages(BufferedImage image, BufferedImage textImage, SignatureFieldDimensionAndPosition dimensionAndPosition, SignatureImageParameters imageParameters) Creates the final image, by merging the givenimageandtextImageaccording to the provided parametersstatic BufferedImagerotate(BufferedImage image, double angle) Rotates the provided image to the givenanglestatic BufferedImagetoBufferedImage(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-SignatureImageParametersto usedimensionAndPosition-SignatureFieldDimensionAndPositionfontMetrics-JavaDSSFontMetrics- Returns:
BufferedImageof 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-Graphics2Dto set
-
mergeImages
public static BufferedImage mergeImages(BufferedImage image, BufferedImage textImage, SignatureFieldDimensionAndPosition dimensionAndPosition, SignatureImageParameters imageParameters) Creates the final image, by merging the givenimageandtextImageaccording to the provided parameters- Parameters:
image-BufferedImagethe image picturetextImage-BufferedImagethe rasterized textdimensionAndPosition-SignatureFieldDimensionAndPositionimageParameters-SignatureImageParameters- Returns:
BufferedImage
-
rotate
Rotates the provided image to the givenangle- Parameters:
image-BufferedImageto rotateangle- the rotation angle- Returns:
- rotated
BufferedImage
-