Package eu.europa.esig.dss.pdf.pdfbox
Class PdfBoxUtils
java.lang.Object
eu.europa.esig.dss.pdf.pdfbox.PdfBoxUtils
-
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 BufferedImagegenerateBufferedImageScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page) Deprecated.since DSS 6.2.static BufferedImagegenerateBufferedImageScreenshot(DSSDocument pdfDocument, String passwordProtection, int page) Deprecated.since DSS 6.2.static DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page) Deprecated.since DSS 6.2.static DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2.static DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, int page) Deprecated.since DSS 6.2.static DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page) Deprecated.since DSS 6.2.static DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2.static DSSDocumentgenerateSubtractionImage(DSSDocument document1, char[] passwordDocument1, int pageDocument1, DSSDocument document2, char[] passwordDocument2, int pageDocument2) Deprecated.since DSS 6.2.static DSSDocumentgenerateSubtractionImage(DSSDocument document1, char[] passwordDocument1, int pageDocument1, DSSDocument document2, char[] passwordDocument2, int pageDocument2, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2.static DSSDocumentgenerateSubtractionImage(DSSDocument document1, DSSDocument document2, int page) Deprecated.since DSS 6.2.static DSSDocumentgenerateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2) Deprecated.since DSS 6.2.static DSSDocumentgenerateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2.static 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
-
generateScreenshot
Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.Generates a screenshot image of the specified page for the given PDF document- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpage- a page number- Returns:
DSSDocumentPNG screenshot
-
generateScreenshot
@Deprecated public static DSSDocument generateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.Generates a screenshot image of the specified page for the given PDF document- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection-Stringa PDF password protection phrasepage- a page number- Returns:
DSSDocumentPNG screenshot
-
generateScreenshot
@Deprecated public static DSSDocument generateScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.Generates a screenshot image of the specified page for the given PDF document- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection- a PDF password protection phrasepage- a page number- Returns:
DSSDocumentPNG screenshot
-
generateScreenshot
@Deprecated public static DSSDocument generateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.Generates a screenshot image of the specified page for the given PDF document using a providedeu.europa.esig.dss.signature.resources.DSSResourcesHandler- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection-Stringa PDF password protection phrasepage- a page numberdssResourcesHandler-DSSResourcesHandler- Returns:
DSSDocumentPNG screenshot
-
generateScreenshot
@Deprecated public static DSSDocument generateScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.Generates a screenshot image of the specified page for the given PDF document using a providedeu.europa.esig.dss.signature.resources.DSSResourcesHandler- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection- a PDF password protection phrasepage- a page numberdssResourcesHandler-DSSResourcesHandler- Returns:
DSSDocumentPNG screenshot
-
generateBufferedImageScreenshot
@Deprecated public static BufferedImage generateBufferedImageScreenshot(DSSDocument pdfDocument, String passwordProtection, int page) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.The method generates a BufferedImage for the specified page of the document with String password- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection-Stringa PDF password protection phrasepage- a page number to be generates (starts from 1)- Returns:
BufferedImage
-
generateBufferedImageScreenshot
@Deprecated public static BufferedImage generateBufferedImageScreenshot(DSSDocument pdfDocument, char[] passwordProtection, int page) Deprecated.since DSS 6.2. Please use a corresponding method inPdfBoxScreenshotBuilderinstead.The method generates a BufferedImage for the specified page of the document- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection- a PDF password protection phrasepage- a page number to be generates (starts from 1)- Returns:
BufferedImage
-
generateSubtractionImage
@Deprecated public static DSSDocument generateSubtractionImage(DSSDocument document1, DSSDocument document2, int page) Deprecated.since DSS 6.2. Please usePdfBoxScreenshotBuilderto generateBufferedImagescreenshots for document pages and compare them usinggenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler)methodThis method returns an image representing a subtraction result betweendocument1anddocument2for the given page number- Parameters:
document1-DSSDocumentdocument2-DSSDocumentpage- page number- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
@Deprecated public static DSSDocument generateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2) Deprecated.since DSS 6.2. Please usePdfBoxScreenshotBuilderto generateBufferedImagescreenshots for document pages and compare them usinggenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler)methodThis method returns an image representing a subtraction result betweendocument1anddocument2for the defined pages- Parameters:
document1-DSSDocumentthe first documentpasswordDocument1-Stringa password protection for thedocument1when applicable (can be null)pageDocument1- page number identifying a page of thedocument1to be proceededdocument2-DSSDocumentthe second documentpasswordDocument2-Stringa password protection for thedocument2when applicable (can be null)pageDocument2- page number identifying a page of thedocument2to be proceeded- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
@Deprecated public static DSSDocument generateSubtractionImage(DSSDocument document1, char[] passwordDocument1, int pageDocument1, DSSDocument document2, char[] passwordDocument2, int pageDocument2) Deprecated.since DSS 6.2. Please usePdfBoxScreenshotBuilderto generateBufferedImagescreenshots for document pages and compare them usinggenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler)methodThis method returns an image representing a subtraction result betweendocument1anddocument2for the defined pages- Parameters:
document1-DSSDocumentthe first documentpasswordDocument1- a password protection for thedocument1when applicable (can be null)pageDocument1- page number identifying a page of thedocument1to be proceededdocument2-DSSDocumentthe second documentpasswordDocument2- a password protection for thedocument2when applicable (can be null)pageDocument2- page number identifying a page of thedocument2to be proceeded- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
@Deprecated public static DSSDocument generateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2. Please usePdfBoxScreenshotBuilderto generateBufferedImagescreenshots for document pages and compare them usinggenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler)methodThis method returns an image representing a subtraction result betweendocument1anddocument2for the defined pages. This method uses a providedDSSResourcesHandler- Parameters:
document1-DSSDocumentthe first documentpasswordDocument1-Stringa password protection for thedocument1when applicable (can be null)pageDocument1- page number identifying a page of thedocument1to be proceededdocument2-DSSDocumentthe second documentpasswordDocument2-Stringa password protection for thedocument2when applicable (can be null)pageDocument2- page number identifying a page of thedocument2to be proceededdssResourcesHandler-DSSResourcesHandlerto be used- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
@Deprecated public static DSSDocument generateSubtractionImage(DSSDocument document1, char[] passwordDocument1, int pageDocument1, DSSDocument document2, char[] passwordDocument2, int pageDocument2, DSSResourcesHandler dssResourcesHandler) Deprecated.since DSS 6.2. Please usePdfBoxScreenshotBuilderto generateBufferedImagescreenshots for document pages and compare them usinggenerateSubtractionImage(BufferedImage screenshotDoc1, BufferedImage screenshotDoc2, DSSResourcesHandler dssResourcesHandler)methodThis method returns an image representing a subtraction result betweendocument1anddocument2for the defined pages. This method uses a providedDSSResourcesHandler- Parameters:
document1-DSSDocumentthe first documentpasswordDocument1- a password protection for thedocument1when applicable (can be null)pageDocument1- page number identifying a page of thedocument1to be proceededdocument2-DSSDocumentthe second documentpasswordDocument2- a password protection for thedocument2when applicable (can be null)pageDocument2- page number identifying a page of thedocument2to be proceededdssResourcesHandler-DSSResourcesHandlerto be used- Returns:
DSSDocumentsubtraction result
-
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
-