public class Obj
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
e_array
The Constant e_array.
|
static int |
e_bool
The Constant e_bool.
|
static int |
e_dict
The Constant e_dict.
|
static int |
e_name
The Constant e_name.
|
static int |
e_null
The Constant e_null.
|
static int |
e_number
The Constant e_number.
|
static int |
e_stream
The Constant e_stream.
|
static int |
e_string
The Constant e_string.
|
| Modifier and Type | Method and Description |
|---|---|
static Obj |
__Create(long impl,
java.lang.Object ref) |
long |
__GetHandle() |
java.lang.Object |
__GetRefHandle() |
void |
erase(DictIterator pos)
Removes an element in the dictionary from specified position.
|
void |
erase(java.lang.String key)
Removes an element in the dictionary that matches the given key.
|
void |
eraseAt(int pos)
Checks whether the position is within the array bounds and then removes it from the
array and moves each subsequent element to the slot with the next smaller index and
decrements the arrays length by 1.
|
DictIterator |
find(java.lang.String key)
Search the dictionary for a given key.
|
Obj |
findObj(java.lang.String key)
Search the dictionary for a given key.
|
DictIterator |
get(java.lang.String key)
Search the dictionary for a given key and throw an exception if the key is not found.
|
java.lang.String |
getAsPDFText()
Convert the SDF/Cos String object to 'PDF Text String' (a Unicode string).
|
Obj |
getAt(int index)
Get the Obj at specified index
|
boolean |
getBool()
Get the boolean value if Obj is bool
|
byte[] |
getBuffer()
Get string buffer
|
Filter |
getDecodedStream()
Get the decoded stream.
|
DictIterator |
getDictIterator()
Get the dictionary iterator.
|
SDFDoc |
getDoc()
Get the Doc object contains this Obj
|
short |
getGenNum()
Get the generation number.
|
java.lang.String |
getName()
Get the string representation of the Name object
|
double |
getNumber()
Get the number value
|
long |
getObjNum()
Get the object number.
|
long |
getOffset()
Get the offset from beginning of the file.
|
Filter |
getRawStream(boolean decrypt)
Get the raw stream.
|
long |
getRawStreamLength()
Get the raw stream length.
|
int |
getType()
Get the Obj type.
|
Obj |
insert(int pos,
Obj obj)
Inserts an existing Obj in this array.
|
Obj |
insertArray(int pos)
Inserts an Obj::Type::e_array object in the array.
|
Obj |
insertBool(int pos,
boolean value)
Inserts an Obj::Type::e_bool object in the array.
|
Obj |
insertDict(int pos)
Inserts an Obj::Type::e_dict object in the array.
|
Obj |
insertMatrix(int pos,
Matrix2D value)
Inserts an array of 6 numbers in this array.
|
Obj |
insertName(int pos,
java.lang.String name)
Inserts an Obj::Type::e_name object in the array.
|
Obj |
insertNull(int pos)
Inserts an Obj::Type::e_null object in the array.
|
Obj |
insertNumber(int pos,
double value)
Inserts an Obj::Type::e_number object in the array.
|
Obj |
insertRect(int pos,
double x1,
double y1,
double x2,
double y2)
Inserts an array of 4 numbers in this array.
|
Obj |
insertString(int pos,
byte[] value)
Inserts an Obj::Type::e_string object in the array.
|
Obj |
insertString(int pos,
java.lang.String value)
Inserts an Obj::Type::e_string object in the array.
|
Obj |
insertText(int pos,
java.lang.String value)
Inserts an Obj::Type::e_string object in the array.
|
boolean |
isArray()
Checks if Obj is an array.
|
boolean |
isBool()
Checks if Obj is Boolean object
|
boolean |
isContainer()
Checks if Obj is a container object.
|
boolean |
isDict()
Checks if Obj is dictionary
|
boolean |
isEqual(Obj to)
Checks if is equal to specified object
|
boolean |
isFree()
Checks if it is marked as free.
|
boolean |
isIndirect()
Checks if Obj is an indirect object
|
boolean |
isLoaded()
Checks if Obj is loaded.
|
boolean |
isMarked()
Checks if Obj is marked.
|
boolean |
isName()
Checks if Obj is a name object.
|
boolean |
isNull()
Checks if is Obj null.
|
boolean |
isNumber()
Checks if Obj is Number object.
|
boolean |
isStream()
Checks if is a stream.
|
boolean |
isString()
Checks if Obj is a string object.
|
Obj |
pushBack(Obj obj)
Appends an existing Obj at the end of the array.
|
Obj |
pushBackArray()
Appends a new Obj::Type::e_array object at the end of the array.
|
Obj |
pushBackBool(boolean value)
Appends a new Obj::Type::e_bool object at the end of the array.
|
Obj |
pushBackDict()
Appends a new Obj::Type::e_dict object at the end of the array.
|
Obj |
pushBackMatrix(Matrix2D value)
Appends an array of 6 numbers at the end of the array.
|
Obj |
pushBackName(java.lang.String name)
Appends a new Obj::Type::e_name object at the end of the array.
|
Obj |
pushBackNull()
Appends a new Obj::Type::e_null object at the end of the array.
|
Obj |
pushBackNumber(double value)
Appends a new Obj::Type::e_number object at the end of the array.
|
Obj |
pushBackRect(double x1,
double y1,
double x2,
double y2)
Appends an array of 4 numbers at the end of the array.
|
Obj |
pushBackString(byte[] value)
Appends a new Obj::Type::e_string object at the end of the array.
|
Obj |
pushBackString(java.lang.String value)
Appends a new Obj::Type::e_string object at the end of the array.
|
Obj |
pushBackText(java.lang.String value)
Appends a new Obj::Type::e_string object at the end of the array.
|
Obj |
put(java.lang.String key,
Obj obj)
Inserts a
|
Obj |
putArray(java.lang.String key)
Inserts a
|
Obj |
putBool(java.lang.String key,
boolean value)
Inserts a
|
Obj |
putDict(java.lang.String key)
Inserts a
|
Obj |
putMatrix(java.lang.String key,
Matrix2D value)
Inserts a
|
Obj |
putName(java.lang.String key,
java.lang.String name)
Inserts a
|
void |
putNull(java.lang.String key)
Inserts a
|
Obj |
putNumber(java.lang.String key,
double value)
Inserts a
|
Obj |
putRect(java.lang.String key,
double x1,
double y1,
double x2,
double y2)
Inserts a
|
Obj |
putString(java.lang.String key,
byte[] value)
Inserts a
|
Obj |
putString(java.lang.String key,
java.lang.String value)
Inserts a
|
Obj |
putText(java.lang.String key,
java.lang.String value)
Inserts a
|
boolean |
rename(java.lang.String old_key,
java.lang.String new_key)
Change the key value of a dictionary entry.
|
void |
setBool(boolean b)
Set the boolean value to Obj
|
void |
setMark(boolean mark)
Set the object mark.
|
void |
setName(java.lang.String name)
Set the name string
|
void |
setNumber(double n)
Set the number value
|
void |
setStreamData(byte[] data,
Filter filter_chain)
Update a stream object with the new content.
|
void |
setString(byte[] buf)
Set the string object value.
|
void |
setString(java.lang.String value)
Set the string object value.
|
long |
size()
Get size of Obj
|
void |
write(FilterWriter stream)
The function writes the Obj to the output stream.
|
public static final int e_null
public static final int e_bool
public static final int e_number
public static final int e_name
public static final int e_string
public static final int e_dict
public static final int e_array
public static final int e_stream
public int getType()
throws PDFNetException
PDFNetExceptionpublic boolean isBool()
throws PDFNetException
PDFNetExceptionpublic boolean isNumber()
throws PDFNetException
PDFNetExceptionpublic boolean isNull()
throws PDFNetException
PDFNetExceptionpublic boolean isString()
throws PDFNetException
PDFNetExceptionpublic boolean isName()
throws PDFNetException
PDFNetExceptionpublic boolean isIndirect()
throws PDFNetException
PDFNetExceptionpublic boolean isContainer()
throws PDFNetException
PDFNetExceptionpublic boolean isDict()
throws PDFNetException
PDFNetExceptionpublic boolean isArray()
throws PDFNetException
PDFNetExceptionpublic boolean isStream()
throws PDFNetException
PDFNetExceptionpublic SDFDoc getDoc() throws PDFNetException
PDFNetExceptionpublic void write(FilterWriter stream) throws PDFNetException
stream - - the input stream where the Obj will be writtenPDFNetExceptionpublic long size()
throws PDFNetException
PDFNetExceptionpublic long getObjNum()
throws PDFNetException
PDFNetExceptionpublic short getGenNum()
throws PDFNetException
PDFNetExceptionpublic long getOffset()
throws PDFNetException
PDFNetExceptionpublic boolean isFree()
throws PDFNetException
PDFNetExceptionpublic void setMark(boolean mark)
throws PDFNetException
mark - the new markPDFNetExceptionpublic boolean isMarked()
throws PDFNetException
PDFNetExceptionpublic boolean isLoaded()
throws PDFNetException
PDFNetExceptionpublic boolean isEqual(Obj to) throws PDFNetException
to - the toPDFNetExceptionpublic boolean getBool()
throws PDFNetException
PDFNetExceptionpublic void setBool(boolean b)
throws PDFNetException
b - - bool value used to set Bool object.PDFNetExceptionpublic double getNumber()
throws PDFNetException
PDFNetExceptionpublic void setNumber(double n)
throws PDFNetException
n - - value used to set Number object.PDFNetExceptionpublic byte[] getBuffer()
throws PDFNetException
PDFNetExceptionpublic java.lang.String getAsPDFText()
throws PDFNetException
PDFNetExceptionpublic void setString(byte[] buf)
throws PDFNetException
buf - the new string bufferPDFNetExceptionpublic void setString(java.lang.String value)
throws PDFNetException
value - the new stringPDFNetExceptionpublic java.lang.String getName()
throws PDFNetException
PDFNetExceptionpublic void setName(java.lang.String name)
throws PDFNetException
name - - value used to set Name object.PDFNetExceptionpublic DictIterator getDictIterator() throws PDFNetException
PDFNetExceptionpublic DictIterator find(java.lang.String key) throws PDFNetException
key - - a key to search for in the dictionaryPDFNetExceptionpublic Obj findObj(java.lang.String key) throws PDFNetException
key - - a key to search for in the dictionaryPDFNetExceptionpublic DictIterator get(java.lang.String key) throws PDFNetException
key - - a key to search for in the dictionaryPDFNetExceptionpublic Obj putName(java.lang.String key, java.lang.String name) throws PDFNetException
key - The key of the value to set.name - The value of the Obj::Type::e_name object to be inserted into
the dictionary.PDFNetExceptionpublic Obj putArray(java.lang.String key) throws PDFNetException
key - The key of the value to set.PDFNetExceptionpublic Obj putBool(java.lang.String key, boolean value) throws PDFNetException
key - The key of the value to set.value - The value of the Obj::Type::e_bool object to be inserted into
the dictionary.PDFNetExceptionpublic Obj putDict(java.lang.String key) throws PDFNetException
key - The key of the value to set.PDFNetExceptionpublic Obj putNumber(java.lang.String key, double value) throws PDFNetException
key - The key of the value to set.value - The value of the Obj::Type::e_number object to be inserted into
the dictionary.PDFNetExceptionpublic Obj putString(java.lang.String key, java.lang.String value) throws PDFNetException
key - The key of the value to set.value - The value of the Obj::Type::e_string object to be inserted into
the dictionary.PDFNetExceptionpublic Obj putString(java.lang.String key, byte[] value) throws PDFNetException
key - The key of the value to set.value - The buffer used to set the value of the Obj::Type::e_string
object to be inserted into the dictionary.PDFNetExceptionpublic Obj putText(java.lang.String key, java.lang.String value) throws PDFNetException
key - The key of the value to set.value - The value of the Obj::Type::e_string object to be inserted into
the dictionary.PDFNetExceptionpublic void putNull(java.lang.String key)
throws PDFNetException
key - The key of the value to set.PDFNetExceptionpublic Obj put(java.lang.String key, Obj obj) throws PDFNetException
key - The key of the value to set.obj - The value to be inserted into the dictionary. If 'obj' is
indirect (i.e. is a shared) object it will be inserted by reference,
otherwise the object will be cloned and then inserted into the dictionary.PDFNetExceptionpublic Obj putRect(java.lang.String key, double x1, double y1, double x2, double y2) throws PDFNetException
key - The key of the value to set.x1 - the x1y1 - the y1x2 - the x2y2 - the y2PDFNetExceptionpublic Obj putMatrix(java.lang.String key, Matrix2D value) throws PDFNetException
key - The key of the value to set.value - - A matrix used to set the values in an array of six numbers.
The resulting array will be inserted into the dictionary.PDFNetExceptionpublic void erase(java.lang.String key)
throws PDFNetException
key - the keyPDFNetExceptionpublic void erase(DictIterator pos) throws PDFNetException
pos - the posPDFNetExceptionpublic boolean rename(java.lang.String old_key,
java.lang.String new_key)
throws PDFNetException
old_key - the old_keynew_key - the new_keyPDFNetExceptionpublic Obj getAt(int index) throws PDFNetException
index - - The array element to obtain. The first element in an array has an index of zero.PDFNetExceptionpublic Obj insertName(int pos, java.lang.String name) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.name - The value of the Obj::Type::e_name object to be inserted.PDFNetExceptionpublic Obj insertArray(int pos) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.PDFNetExceptionpublic Obj insertBool(int pos, boolean value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - The value of the Obj::Type::e_bool object to be inserted.PDFNetExceptionpublic Obj insertDict(int pos) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.PDFNetExceptionpublic Obj insertNumber(int pos, double value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - The value of the Obj::Type::e_number object to be inserted.PDFNetExceptionpublic Obj insertString(int pos, java.lang.String value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - The value of the Obj::Type::e_string object to be inserted.PDFNetExceptionpublic Obj insertString(int pos, byte[] value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - The buffer used to set the value of the Obj::Type::e_string
object to be inserted.PDFNetExceptionpublic Obj insertText(int pos, java.lang.String value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - The value of the Obj::Type::e_string object to be inserted.PDFNetExceptionpublic Obj insertNull(int pos) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.PDFNetExceptionpublic Obj insert(int pos, Obj obj) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.obj - The value to be inserted into the dictionary. If 'obj' is
indirect (i.e. is a shared) object it will be inserted by reference,
otherwise the object will be cloned and then inserted.PDFNetExceptionpublic Obj insertRect(int pos, double x1, double y1, double x2, double y2) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.x1 - the x1y1 - the y1x2 - the x2y2 - the y2PDFNetExceptionpublic Obj insertMatrix(int pos, Matrix2D value) throws PDFNetException
pos - - The location in the array to insert the object . The object is inserted
before the specified location. The first element in an array has a pos of
zero. If pos >= Array->Length(), appends obj to array.value - - A matrix used to set the values in an array of six numbers.
The resulting array will be then inserted in this array.PDFNetExceptionpublic Obj pushBackName(java.lang.String name) throws PDFNetException
name - - The value of the Obj::Type::e_name object.PDFNetExceptionpublic Obj pushBackArray() throws PDFNetException
PDFNetExceptionpublic Obj pushBackBool(boolean value) throws PDFNetException
value - the valuePDFNetExceptionpublic Obj pushBackDict() throws PDFNetException
PDFNetExceptionpublic Obj pushBackNumber(double value) throws PDFNetException
value - - The value of the Obj::Type::e_number object.PDFNetExceptionpublic Obj pushBackString(java.lang.String value) throws PDFNetException
value - - The value of the Obj::Type::e_string object.PDFNetExceptionpublic Obj pushBackString(byte[] value) throws PDFNetException
value - The buffer used to set the value of the Obj::Type::e_string
object to be inserted.PDFNetExceptionpublic Obj pushBackText(java.lang.String value) throws PDFNetException
value - The value of the Obj::Type::e_string object to be inserted.PDFNetExceptionpublic Obj pushBackNull() throws PDFNetException
PDFNetExceptionpublic Obj pushBack(Obj obj) throws PDFNetException
obj - The value to be inserted into the dictionary. If 'obj' is
indirect (i.e. is a shared) object it will be inserted by reference,
otherwise the object will be cloned and then appended.PDFNetExceptionpublic Obj pushBackRect(double x1, double y1, double x2, double y2) throws PDFNetException
x1 - the x1y1 - the y1x2 - the x2y2 - the y2PDFNetExceptionpublic Obj pushBackMatrix(Matrix2D value) throws PDFNetException
value - - A matrix used to set the values in an array of six numbers.
The resulting array will be then inserted in this array.PDFNetExceptionpublic void eraseAt(int pos)
throws PDFNetException
pos - the posPDFNetExceptionpublic long getRawStreamLength()
throws PDFNetException
PDFNetExceptionpublic Filter getRawStream(boolean decrypt) throws PDFNetException
decrypt - - If true decrypt the stream if the stream is encrypted.PDFNetExceptionpublic Filter getDecodedStream() throws PDFNetException
PDFNetExceptionpublic void setStreamData(byte[] data,
Filter filter_chain)
throws PDFNetException
data - the datafilter_chain - the filter_chainPDFNetExceptionpublic static Obj __Create(long impl, java.lang.Object ref)
public long __GetHandle()
public java.lang.Object __GetRefHandle()