Package eu.europa.esig.dss.pdf.pdfbox
Class PdfBoxUtils
java.lang.Object
eu.europa.esig.dss.pdf.pdfbox.PdfBoxUtils
public class PdfBoxUtils extends Object
Contains a set of utils for PdfBox implementation
-
Method Summary
Modifier and Type Method Description static BufferedImagegenerateBufferedImageScreenshot(DSSDocument pdfDocument, String passwordProtection, int page)The method generates a BufferedImage for the specified page of the documentstatic BufferedImagegenerateBufferedImageScreenshot(org.apache.pdfbox.pdmodel.PDDocument pdDocument, int page)The method generates a BufferedImage for the specified page of the documentstatic DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, int page)Generates a screenshot image of the specified page for the given PDF documentstatic DSSDocumentgenerateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page)Generates a screenshot image of the specified page for the given PDF documentstatic DSSDocumentgenerateSubtractionImage(DSSDocument document1, DSSDocument document2, int page)This method returns an image representing a subtraction result betweendocument1anddocument2for the given page numberstatic DSSDocumentgenerateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2)This method returns an image representing a subtraction result betweendocument1anddocument2for the defined pages
-
Method Details
-
generateScreenshot
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
public static DSSDocument generateScreenshot(DSSDocument pdfDocument, String passwordProtection, int page)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
-
generateBufferedImageScreenshot
public static BufferedImage generateBufferedImageScreenshot(DSSDocument pdfDocument, String passwordProtection, int page)The method generates a BufferedImage for the specified page of the document- Parameters:
pdfDocument-DSSDocumentto generate screenshot forpasswordProtection-Stringa PDF password protection phrasepage- a page number to be generates (starts from 1)- Returns:
BufferedImage
-
generateBufferedImageScreenshot
public static BufferedImage generateBufferedImageScreenshot(org.apache.pdfbox.pdmodel.PDDocument pdDocument, int page) throws IOExceptionThe method generates a BufferedImage for the specified page of the document- Parameters:
pdDocument-PDDocumentto generate screenshot forpage- a page number to be generates (starts from 1)- Returns:
BufferedImage- Throws:
IOException- if an exception occurs
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(DSSDocument document1, DSSDocument document2, int page)This method returns an image representing a subtraction result betweendocument1anddocument2for the given page number- Parameters:
document1-DSSDocumentdocument2-DSSDocumentpage- page number- Returns:
DSSDocumentsubtraction result
-
generateSubtractionImage
public static DSSDocument generateSubtractionImage(DSSDocument document1, String passwordDocument1, int pageDocument1, DSSDocument document2, String passwordDocument2, int pageDocument2)This 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
-