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<PdfSignatureField>> extractSigDictionaries() throws IOException
      Extracts PdfSignatureDictionaries present in the signature
      Returns:
      a map between PdfSignatureDictionary and related PdfSignatureFields
      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 of a page to get annotation box of
      Returns:
      AnnotationBox representing page dimensions
    • getPageRotation

      int getPageRotation(int page)
      This method returns a corresponding page's rotation within the document
      Parameters:
      page - number of a page to get rotation of
      Returns:
      rotation degrees
    • 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
    • isEncrypted

      boolean isEncrypted()
      This method checks whether the document is encrypted
      Returns:
      TRUE if the document is encrypted, FALSE otherwise
    • isOpenWithOwnerAccess

      boolean isOpenWithOwnerAccess()
      This method verifies if the document has been opened with a full owner access (all modifications are permitted)
      Returns:
      TRUE if the document has been open with a full access, FALSE otherwise
    • canFillSignatureForm

      boolean canFillSignatureForm()
      This method verifies whether fill-in of existing signature fields is allowed by PDF document permissions dictionary
      Returns:
      TRUE if fill-in signature forms is permitted, FALSE otherwise
    • canCreateSignatureField

      boolean canCreateSignatureField()
      This method verifies whether creation of new signature fields is allowed by the PDF permissions dictionary
      Returns:
      TRUE if the new signature field creation is permitted, FALSE otherwise
    • getCertificationPermission

      CertificationPermission getCertificationPermission()
      Returns value of /DocMDP dictionary defining the permitted modification in a PDF, when present
      Returns:
      CertificationPermission
    • isUsageRightsSignaturePresent

      boolean isUsageRightsSignaturePresent()
      This method verifies whether a PDF contains a usage rights signature
      Returns:
      TRUE of a PDF contains a usage rights signature, FALSE otherwise
    • getCatalogDictionary

      PdfDict getCatalogDictionary()
      Returns a document catalog as a dictionary
      Returns:
      PdfDict