Package eu.europa.esig.dss.pdf.openpdf
Class ITextDocumentReader
java.lang.Object
eu.europa.esig.dss.pdf.openpdf.ITextDocumentReader
- All Implemented Interfaces:
PdfDocumentReader,Closeable,AutoCloseable
public class ITextDocumentReader extends Object implements PdfDocumentReader
-
Constructor Summary
Constructors Constructor Description ITextDocumentReader(byte[] binaries, byte[] passwordProtection)The OpenPDF implementation of the ReaderITextDocumentReader(DSSDocument dssDocument)Default constructor of the OpenPDF implementation of the ReaderITextDocumentReader(DSSDocument dssDocument, byte[] passwordProtection)The OpenPDF implementation of the Reader -
Method Summary
Modifier and Type Method Description voidclose()Map<PdfSignatureDictionary,List<String>>extractSigDictionaries()Extracts PdfSignatureSictionaries present in the signaturePdfDssDictgetDSSDictionary()Loads the last DSS dictionary from the document if exists NOTE: can return null if DSS dictionary is not presentbooleanisSignatureCoversWholeDocument(PdfSignatureDictionary signatureDictionary)Checks if a signature for the given PDF Signature Dictionary covers the whole document
-
Constructor Details
-
ITextDocumentReader
Default constructor of the OpenPDF implementation of the Reader- Parameters:
dssDocument-DSSDocumentto read- Throws:
IOException- if an exception occursInvalidPasswordException- if the password is not provided or invalid for a protected document
-
ITextDocumentReader
public ITextDocumentReader(DSSDocument dssDocument, byte[] passwordProtection) throws IOException, InvalidPasswordExceptionThe OpenPDF implementation of the Reader- Parameters:
dssDocument-DSSDocumentto readpasswordProtection- binaries of a password to open a protected document- Throws:
IOException- if an exception occursInvalidPasswordException- if the password is not provided or invalid for a protected document
-
ITextDocumentReader
public ITextDocumentReader(byte[] binaries, byte[] passwordProtection) throws IOException, InvalidPasswordExceptionThe OpenPDF implementation of the Reader- Parameters:
binaries- a byte array of a PDF to readpasswordProtection- binaries of a password to open a protected document- Throws:
IOException- if an exception occursInvalidPasswordException- if the password is not provided or invalid for a protected document
-
-
Method Details
-
getDSSDictionary
Description copied from interface:PdfDocumentReaderLoads the last DSS dictionary from the document if exists NOTE: can return null if DSS dictionary is not present- Specified by:
getDSSDictionaryin interfacePdfDocumentReader- Returns:
PdfDssDict
-
extractSigDictionaries
Description copied from interface:PdfDocumentReaderExtracts PdfSignatureSictionaries present in the signature- Specified by:
extractSigDictionariesin interfacePdfDocumentReader- Returns:
- a map between
PdfSignatureDictionaryand related field names
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isSignatureCoversWholeDocument
Description copied from interface:PdfDocumentReaderChecks if a signature for the given PDF Signature Dictionary covers the whole document- Specified by:
isSignatureCoversWholeDocumentin interfacePdfDocumentReader- Parameters:
signatureDictionary-PdfSignatureDictionaryto check the result for- Returns:
- TRUE if the signature covers the whole document, false otherwise
-