org.icepdf.core.pobjects
Interface StringObject

All Known Implementing Classes:
HexStringObject, LiteralStringObject

public interface StringObject

This class represents a PDF String Object. A StringObject consists of a series of bytes in the range 0 to 255. A StringObject can be written in two ways:

The methods define in this interface are common to both Literal and Hexadecimal Strings Object.

Since:
2.0

Method Summary
 java.lang.String getDecryptedLiteralString(SecurityManager securityManager)
          Gets the decrypted literal string value of the data using the key provided by the security manager.
 java.lang.String getHexString()
          Gets a hexadecimal String representation of this object's data.
 java.lang.StringBuilder getHexStringBuffer()
          Gets a hexadecimal StringBuffer representation of this objects data.
 int getLength()
          The length of the underlying objects data.
 java.lang.String getLiteralString()
          Gets a literal String representation of this object's data.
 java.lang.StringBuilder getLiteralStringBuffer()
          Gets a literal StringBuffer representation of this object's data.
 java.lang.StringBuilder getLiteralStringBuffer(int fontFormat, FontFile font)
          Gets a literal String representation of this objects data using the specified font and format.
 Reference getReference()
          Sets the parent PDF object's reference.
 int getUnsignedInt(int start, int offset)
          Gets the unsigned integer value of this object's data specified by the start index and offset parameters.
 void setReference(Reference reference)
          Sets the parent PDF object's reference.
 java.lang.String toString()
          Returns a string representation of the object.
 

Method Detail

toString

java.lang.String toString()

Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the object.

getLiteralStringBuffer

java.lang.StringBuilder getLiteralStringBuffer()

Gets a literal StringBuffer representation of this object's data.

Returns:
a StringBuffer representing the objects data.

getLiteralString

java.lang.String getLiteralString()

Gets a literal String representation of this object's data.

Returns:
a String representation of the object's data.

getHexStringBuffer

java.lang.StringBuilder getHexStringBuffer()

Gets a hexadecimal StringBuffer representation of this objects data.

Returns:
a StringBufffer representation of the objects data.

getHexString

java.lang.String getHexString()

Gets a hexadecimal String representation of this object's data.

Returns:
a String representation of the object's data.

getUnsignedInt

int getUnsignedInt(int start,
                   int offset)
Gets the unsigned integer value of this object's data specified by the start index and offset parameters.

Parameters:
start - the beginning index, inclusive.
offset - the number of string characters to read.
Returns:
integer value of the specified range of characters.

getLiteralStringBuffer

java.lang.StringBuilder getLiteralStringBuffer(int fontFormat,
                                               FontFile font)
Gets a literal String representation of this objects data using the specified font and format.

Parameters:
fontFormat - the type of PDF font which will be used to display the text. Valid values are CID_FORMAT and SIMPLE_FORMAT for Adobe Composite and Simple font types respectively
font - font used to render the literal string data.
Returns:
StringBuffer which contains all renderaable characters for the given font.

getLength

int getLength()
The length of the underlying objects data.

Returns:
length of objct's data.

setReference

void setReference(Reference reference)
Sets the parent PDF object's reference.

Parameters:
reference - parent object reference.

getReference

Reference getReference()
Sets the parent PDF object's reference.

Returns:
returns the reference used for encryption.

getDecryptedLiteralString

java.lang.String getDecryptedLiteralString(SecurityManager securityManager)
Gets the decrypted literal string value of the data using the key provided by the security manager.

Parameters:
securityManager - security manager associated with parent document.
Returns:
decrypted stream.