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 Details

    • generateScreenshot

      public static DSSDocument generateScreenshot​(DSSDocument pdfDocument, int page)
      Generates a screenshot image of the specified page for the given PDF document
      Parameters:
      pdfDocument - DSSDocument to generate screenshot for
      page - a page number
      Returns:
      DSSDocument PNG 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 - DSSDocument to generate screenshot for
      passwordProtection - String a PDF password protection phrase
      page - a page number
      Returns:
      DSSDocument PNG 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 - DSSDocument to generate screenshot for
      passwordProtection - String a PDF password protection phrase
      page - 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 IOException
      The method generates a BufferedImage for the specified page of the document
      Parameters:
      pdDocument - PDDocument to generate screenshot for
      page - 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 between document1 and document2 for the given page number
      Parameters:
      document1 - DSSDocument
      document2 - DSSDocument
      page - page number
      Returns:
      DSSDocument subtraction 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 between document1 and document2 for the defined pages
      Parameters:
      document1 - DSSDocument the first document
      passwordDocument1 - String a password protection for the document1 when applicable (can be null)
      pageDocument1 - page number identifying a page of the document1 to be proceeded
      document2 - DSSDocument the second document
      passwordDocument2 - String a password protection for the document2 when applicable (can be null)
      pageDocument2 - page number identifying a page of the document2 to be proceeded
      Returns:
      DSSDocument subtraction result