Interface PdfDocumentReader

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ITextDocumentReader, PdfBoxDocumentReader

public interface PdfDocumentReader
extends Closeable
Reads the PDF Document
  • Method Details

    • getDSSDictionary

      PdfDssDict getDSSDictionary()
      Loads the last DSS dictionary from the document if exists NOTE: can return null if DSS dictionary is not present
      Returns:
      PdfDssDict
    • extractSigDictionaries

      Map<PdfSignatureDictionary,​List<String>> extractSigDictionaries() throws IOException
      Extracts PdfSignatureDictionaries present in the signature
      Returns:
      a map between PdfSignatureDictionary and related field names
      Throws:
      IOException - if an exception occurs
    • isSignatureCoversWholeDocument

      boolean isSignatureCoversWholeDocument​(PdfSignatureDictionary signatureDictionary)
      Checks if a signature for the given PDF Signature Dictionary covers the whole document
      Parameters:
      signatureDictionary - PdfSignatureDictionary to check the result for
      Returns:
      TRUE if the signature covers the whole document, false otherwise
    • getNumberOfPages

      int getNumberOfPages()
      Returns an amount of pages found in the document
      Returns:
      number of pages
    • getPageBox

      AnnotationBox getPageBox​(int page)
      Returns a page box dimensions
      Parameters:
      page - number
      Returns:
      AnnotationBox representing page dimensions
    • getPdfAnnotations

      List<PdfAnnotation> getPdfAnnotations​(int page) throws IOException
      Retrieves all annotations found in the document
      Parameters:
      page - number
      Returns:
      a list of PdfAnnotations associated with the given page
      Throws:
      IOException - if an exception occurs
    • generateImageScreenshot

      BufferedImage generateImageScreenshot​(int page) throws IOException
      Generates the image screenshot for the given page of the PDF
      Parameters:
      page - number to be generated
      Returns:
      BufferedImage screenshot for the given page
      Throws:
      IOException - if an exception occurs
    • generateImageScreenshotWithoutAnnotations

      BufferedImage generateImageScreenshotWithoutAnnotations​(int page, List<PdfAnnotation> addedAnnotations) throws IOException
      Generates the image screenshot by hiding the given list of annotationBoxes
      Parameters:
      page - number to be generated
      addedAnnotations - a list of PdfAnnotations to be hidden
      Returns:
      BufferedImage screenshot for the given page
      Throws:
      IOException - if an exception occurs