Package eu.europa.esig.dss.pdf
Interface PdfDict
- All Superinterfaces:
PdfObject
The usage of this interface permit the user to choose the underlying PDF
library use to created PDF signatures.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new raw input stream.getAsArray(String name) Gets the pdfArray by nameGets an embedded dictionary by namebyte[]getBinariesValue(String name) Gets binaries by dictionary namegetDateValue(String name) Gets a dategetNameValue(String name) Gets a name of the dictionarygetNumberValue(String name) Returns a number valueReturns a PDF objectgetObjectKey(String name) Returns a Pdf object ket of indirect reference to an object, when applicablelongReturns a size of the raw stream, if presentbyte[]Returns object's stream binaries, when availablegetStringValue(String name) Gets a string value by property nameString[]list()Lists all encapsulated dictionary namesbooleanThis method verifies if the content of thepdfDictmatches the corresponding attributes of the current dictionary.voidsetDirect(boolean direct) Sets whether the object shall be written directly to its parentvoidsetIntegerValue(String key, Integer value) Sets the Integervaluewith the givenkeyvoidsetNameValue(String key, String value) Sets the Namevaluewith the givenkeyvoidsetPdfObjectValue(String key, PdfObject pdfObject) Sets the DictionarypdfObjectwith the givenkeyvoidsetStringValue(String key, String value) Sets the Stringvaluewith the givenkey
-
Method Details
-
getAsDict
Gets an embedded dictionary by name -
getAsArray
Gets the pdfArray by name -
getBinariesValue
Gets binaries by dictionary name- Parameters:
name-String- Returns:
- byte array
- Throws:
IOException- if an exception occurs
-
list
String[] list()Lists all encapsulated dictionary names- Returns:
- an array of
Strings
-
getStringValue
Gets a string value by property name -
getNameValue
Gets a name of the dictionary -
getDateValue
Gets a date -
getNumberValue
Returns a number value -
getObject
Returns a PDF object -
getObjectKey
Returns a Pdf object ket of indirect reference to an object, when applicable- Parameters:
name-Stringproperty name- Returns:
PdfObjectKey
-
getStreamBytes
Returns object's stream binaries, when available- Returns:
- byte array
- Throws:
IOException- if a stream reading exception occurs
-
createRawInputStream
Creates a new raw input stream. NOTE: contains raw and not encoded data.- Returns:
InputStream- Throws:
IOException- if a stream reading exception occurs
-
getRawStreamSize
Returns a size of the raw stream, if present- Returns:
- size of the raw stream, -1 if not applicable
- Throws:
IOException- if a stream reading exception occurs
-
setPdfObjectValue
Sets the DictionarypdfObjectwith the givenkey -
setNameValue
Sets the Namevaluewith the givenkey -
setStringValue
Sets the Stringvaluewith the givenkey -
setIntegerValue
Sets the Integervaluewith the givenkey -
setDirect
void setDirect(boolean direct) Sets whether the object shall be written directly to its parent- Parameters:
direct- whether the object shall be written directly
-
match
This method verifies if the content of thepdfDictmatches the corresponding attributes of the current dictionary. NOTE: this method is different from#equals, as it does not ensure full equality.- Parameters:
pdfDict-PdfDictto compare- Returns:
- TRUE if the content of pdfDict matches, FALSE otherwise
-