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.PDAppearanceDictionarycreateSignatureAppearanceDictionary(org.apache.pdfbox.pdmodel.PDDocument pdDocument, org.apache.pdfbox.pdmodel.common.PDRectangle pdRectangle) This method creates a generic Appearance dictionary, containing a Normal Appearancestatic DSSDocumentgenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2) This method returns an image representing a subtraction result betweenscreenshotDoc1andscreenshotDoc2.static DSSDocumentgenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler) This method returns an image representing a subtraction result betweenscreenshotDoc1andscreenshotDoc2.static org.apache.pdfbox.io.MemoryUsageSettinggetMemoryUsageSetting(PdfMemoryUsageSetting pdfMemoryUsageSetting) It converts genericPdfMemoryUsageSettingto PDF Box domain
-
Method Details
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2) This method returns an image representing a subtraction result betweenscreenshotDoc1andscreenshotDoc2. This method uses a default in-memoryDSSResourcesHandler- Parameters:
screenshotDoc1-BufferedImagethe first screenshot to comparescreenshotDoc2-BufferedImagethe second screenshot to compare with- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler) This method returns an image representing a subtraction result betweenscreenshotDoc1andscreenshotDoc2. This method uses a providedDSSResourcesHandler.- Parameters:
screenshotDoc1-BufferedImagethe first screenshot to comparescreenshotDoc2-BufferedImagethe second screenshot to compare withdssResourcesHandler-DSSResourcesHandlerto be used- Returns:
DSSDocumentsubtraction 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-PDDocumentto create a new Appearance dictionary inpdRectangle-PDRectangleused for annotation dictionary- Returns:
PDAppearanceDictionary
-
getMemoryUsageSetting
public static org.apache.pdfbox.io.MemoryUsageSetting getMemoryUsageSetting(PdfMemoryUsageSetting pdfMemoryUsageSetting) It converts genericPdfMemoryUsageSettingto PDF Box domain- Parameters:
pdfMemoryUsageSetting-PdfMemoryUsageSetting- Returns:
MemoryUsageSetting
-