Package eu.europa.esig.dss.pdf.pdfbox
Class PdfBoxUtils
java.lang.Object
eu.europa.esig.dss.pdf.pdfbox.PdfBoxUtils
Contains a set of utils for PdfBox implementation
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary
createSignatureAppearanceDictionary
(org.apache.pdfbox.pdmodel.PDDocument pdDocument, org.apache.pdfbox.pdmodel.common.PDRectangle pdRectangle) This method creates a generic Appearance dictionary, containing a Normal Appearancestatic DSSDocument
generateSubtractionImage
(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2) This method returns an image representing a subtraction result betweenscreenshotDoc1
andscreenshotDoc2
.static DSSDocument
generateSubtractionImage
(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler) This method returns an image representing a subtraction result betweenscreenshotDoc1
andscreenshotDoc2
.static org.apache.pdfbox.io.MemoryUsageSetting
getMemoryUsageSetting
(PdfMemoryUsageSetting pdfMemoryUsageSetting) It converts genericPdfMemoryUsageSetting
to PDF Box domain
-
Method Details
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2) This method returns an image representing a subtraction result betweenscreenshotDoc1
andscreenshotDoc2
. This method uses a default in-memoryDSSResourcesHandler
- Parameters:
screenshotDoc1
-BufferedImage
the first screenshot to comparescreenshotDoc2
-BufferedImage
the second screenshot to compare with- Returns:
DSSDocument
subtraction result
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler) This method returns an image representing a subtraction result betweenscreenshotDoc1
andscreenshotDoc2
. This method uses a providedDSSResourcesHandler
.- Parameters:
screenshotDoc1
-BufferedImage
the first screenshot to comparescreenshotDoc2
-BufferedImage
the second screenshot to compare withdssResourcesHandler
-DSSResourcesHandler
to be used- Returns:
DSSDocument
subtraction result
-
createSignatureAppearanceDictionary
public static org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary createSignatureAppearanceDictionary(org.apache.pdfbox.pdmodel.PDDocument pdDocument, org.apache.pdfbox.pdmodel.common.PDRectangle pdRectangle) This method creates a generic Appearance dictionary, containing a Normal Appearance- Parameters:
pdDocument
-PDDocument
to create a new Appearance dictionary inpdRectangle
-PDRectangle
used for annotation dictionary- Returns:
PDAppearanceDictionary
-
getMemoryUsageSetting
public static org.apache.pdfbox.io.MemoryUsageSetting getMemoryUsageSetting(PdfMemoryUsageSetting pdfMemoryUsageSetting) It converts genericPdfMemoryUsageSetting
to PDF Box domain- Parameters:
pdfMemoryUsageSetting
-PdfMemoryUsageSetting
- Returns:
MemoryUsageSetting
-