Module jpms_dss_pades_pdfbox
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(eu.europa.esig.dss.pades.SignatureImageParameters imageParameters, eu.europa.esig.dss.pdf.visible.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, eu.europa.esig.dss.pdf.visible.SignatureFieldDimensionAndPosition dimensionAndPosition, eu.europa.esig.dss.pades.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(eu.europa.esig.dss.model.DSSDocument imageDocument) Reads and converts the given image document to aBufferedImage
-
Method Details
-
createTextImage
public static BufferedImage createTextImage(eu.europa.esig.dss.pades.SignatureImageParameters imageParameters, eu.europa.esig.dss.pdf.visible.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, eu.europa.esig.dss.pdf.visible.SignatureFieldDimensionAndPosition dimensionAndPosition, eu.europa.esig.dss.pades.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
-