Package eu.europa.esig.dss.pdf
Interface PdfDocumentReader
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ITextDocumentReader
,PdfBoxDocumentReader
public interface PdfDocumentReader extends Closeable
Reads the PDF Document
-
Method Summary
Modifier and Type Method Description Map<PdfSignatureDictionary,List<String>>
extractSigDictionaries()
Extracts PdfSignatureDictionaries present in the signatureBufferedImage
generateImageScreenshot(int page)
Generates the image screenshot for the given page of the PDFBufferedImage
generateImageScreenshotWithoutAnnotations(int page, List<PdfAnnotation> addedAnnotations)
Generates the image screenshot by hiding the given list ofannotationBoxes
PdfDssDict
getDSSDictionary()
Loads the last DSS dictionary from the document if exists NOTE: can return null if DSS dictionary is not presentint
getNumberOfPages()
Returns an amount of pages found in the documentAnnotationBox
getPageBox(int page)
Returns a page box dimensionsList<PdfAnnotation>
getPdfAnnotations(int page)
Retrieves all annotations found in the documentboolean
isSignatureCoversWholeDocument(PdfSignatureDictionary signatureDictionary)
Checks if a signature for the given PDF Signature Dictionary covers the whole 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
Extracts PdfSignatureDictionaries present in the signature- Returns:
- a map between
PdfSignatureDictionary
and related field names - Throws:
IOException
- if an exception occurs
-
isSignatureCoversWholeDocument
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
Returns a page box dimensions- Parameters:
page
- number- Returns:
AnnotationBox
representing page dimensions
-
getPdfAnnotations
Retrieves all annotations found in the document- Parameters:
page
- number- Returns:
- a list of
PdfAnnotation
s associated with the given page - Throws:
IOException
- if an exception occurs
-
generateImageScreenshot
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 IOExceptionGenerates the image screenshot by hiding the given list ofannotationBoxes
- Parameters:
page
- number to be generatedaddedAnnotations
- a list ofPdfAnnotation
s to be hidden- Returns:
BufferedImage
screenshot for the given page- Throws:
IOException
- if an exception occurs
-