Summary: Constants | Methods | Inherited Methods | [Expand All]
public class

# Obj

extends Object

java.lang.Object
↳ | com.pdftron.sdf.Obj

## Class Overview

Obj is a concrete class for all SDF/Cos objects. Obj hierarchy implements the composite design pattern. As a result, you can invoke a member function of any 'derived' object through Obj interface. If the member function is not supported (e.g. if you invoke Obj::GetNumber() on a boolean object) an Exception will be thrown. You can use GetType() or obl.Is???() member functions to find out type-information at run time, however most of the time the type can be inferred from the PDF specification. Therefore when you call Doc::GetTrailer() you can assume that returned object is a dictionary. If there is any ambiguity use Is???() methods. Objects can't be shared across documents, however you can use Doc::ImportObj() to copy objects from one document to another. Objects can be shared within a document provided that they are created as indirect. Indirect objects are the ones that are referenced in cross-reference table. To create an object as indirect use Doc::CreateIndirect???() (where ? is the Object type).

## Summary

Constants
int | e_array | The Constant e_array.
int | e_bool | The Constant e_bool.
int | e_dict | The Constant e_dict.
int | e_name | The Constant e_name.
int | e_null | The Constant e_null.
int | e_number | The Constant e_number.
int | e_stream | The Constant e_stream.
int | e_string | The Constant e_string.

Public Methods
static Obj | __Create(long impl, Object ref)
long | __GetHandle()
Object | __GetRefHandle()
void | erase(DictIterator pos) Removes an element in the dictionary from specified position.
void | erase(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(String key) Search the dictionary for a given key.
Obj | findObj(String key) Search the dictionary for a given key.
DictIterator | get(String key) Search the dictionary for a given key and throw an exception if the key is not found.
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 Note: if SDF/Cos String object is represented as 'PDF Text' (Section 3.8.1 'Text Strings' in PDF Reference) you can use GetAsPDFText method to obtain Unicode representation of the string.
Filter | getDecodedStream() Get the decoded stream.
DictIterator | getDictIterator() Get the dictionary iterator.
SDFDoc | getDoc() Get the Doc object contains this Obj Note: this method can be invoked on any Obj.
short | getGenNum() Get the generation number.
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.
byte[] | getRawBuffer() Get an array containg the encrypted string buffer.
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, 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 | insertRect(int pos, Rectangle2D.Double rect) Inserts an array of 4 numbers in this array.
Obj | insertString(int pos, String value) Inserts an Obj::Type::e_string object in the array.
Obj | insertString(int pos, byte[] value) Inserts an Obj::Type::e_string object in the array.
Obj | insertText(int pos, 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 Note: this method can be invoked on any Obj.
boolean | isContainer() Checks if Obj is a container object.
boolean | isDict() Checks if Obj is dictionary Note: this method can be invoked on any Obj.
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 Note: this method can be invoked on any Obj.
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(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(Rectangle2D.Double rect) Appends an array of 4 numbers 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(String value) Appends a new Obj::Type::e_string object 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 | pushBackText(String value) Appends a new Obj::Type::e_string object at the end of the array.
Obj | put(String key, Obj obj) Inserts a <key, Obj> pair in the dictionary.
Obj | putArray(String key) Inserts a <key, Obj::Type::e_array> pair in the dictionary.
Obj | putBool(String key, boolean value) Inserts a <key, Obj::Type::e_bool> pair in the dictionary.
Obj | putDict(String key) Inserts a <key, Obj::Type::e_dict> pair in the dictionary.
Obj | putMatrix(String key, Matrix2D value) Inserts a <key, [a,b,c,d,h,v]> pair in the dictionary.
Obj | putName(String key, String name) Inserts a <key, Obj::Type::e_name> pair in the dictionary.
void | putNull(String key) Inserts a <key, Obj::Type::e_null> pair in the dictionary.
Obj | putNumber(String key, double value) Inserts a <key, Obj::Type::e_number> pair in the dictionary.
Obj | putRect(String key, Rectangle2D.Double rect) Inserts a <key, [x1,y1,x2,y2]> pair in the dictionary.
Obj | putRect(String key, double x1, double y1, double x2, double y2) Inserts a <key, [x1,y1,x2,y2]> pair in the dictionary.
Obj | putString(String key, byte[] value) Inserts a <key, Obj::Type::e_string> pair in the dictionary.
Obj | putString(String key, String value) Inserts a <key, Obj::Type::e_string> pair in the dictionary.
Obj | putText(String key, String value) Inserts a <key, Obj::Type::e_string> pair in the dictionary.
boolean | rename(String old_key, 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(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(String value) Set the string object value.
long | size() Get size of Obj Note: this method can be invoked on any Obj.
void | write(FilterWriter stream) The function writes the Obj to the output stream.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_array

The Constant e_array.

Constant Value: 6 (0x00000006)

#### public static final int e_bool

The Constant e_bool.

Constant Value: 1 (0x00000001)

#### public static final int e_dict

The Constant e_dict.

Constant Value: 5 (0x00000005)

#### public static final int e_name

The Constant e_name.

Constant Value: 3 (0x00000003)

#### public static final int e_null

The Constant e_null.

Constant Value: 0 (0x00000000)

#### public static final int e_number

The Constant e_number.

Constant Value: 2 (0x00000002)

#### public static final int e_stream

The Constant e_stream.

Constant Value: 7 (0x00000007)

#### public static final int e_string

The Constant e_string.

Constant Value: 4 (0x00000004)

## Public Methods

#### public static Obj __Create (long impl, Object ref)

#### public long __GetHandle ()

#### public Object __GetRefHandle ()

#### public void erase (DictIterator pos)

Removes an element in the dictionary from specified position.

##### Parameters

pos | the pos

##### Throws

PDFNetException |

#### public void erase (String key)

Removes an element in the dictionary that matches the given key.

##### Parameters

key | the key

##### Throws

PDFNetException |

#### public 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.

##### Parameters

pos | the pos

##### Throws

PDFNetException |

#### public DictIterator find (String key)

Search the dictionary for a given key.

Note: A dictionary entry whose value is Obj::Null is equivalent to an absent entry. `DictIterator itr = info_dict.find("Info"); if (itr.hasCurrent()) { Obj info = itr.value(); if (info.isDict()) info.putString("Producer", "PDFTron PDFNet SDK");` }

##### Parameters

key | - a key to search for in the dictionary

##### Returns

- The iterator to the matching key/value pair or invalid iterator (i.e. itr.hasCurrent()==fase) if the if the dictionary does not contain the given key.

##### Throws

PDFNetException |

#### public Obj findObj (String key)

Search the dictionary for a given key.

Note: A dictionary entry whose value is Obj::Null is equivalent to an absent entry.

##### Parameters

key | - a key to search for in the dictionary

##### Returns

- NULL if the dictionary does not contain the specified key. Otherwise return the corresponding value.

##### Throws

PDFNetException |

#### public DictIterator get (String key)

Search the dictionary for a given key and throw an exception if the key is not found.

##### Parameters

key | - a key to search for in the dictionary

##### Returns

- Obj::Null object if the value matching specified key is a Obj::Null object. otherwise return the interator to the matching key/value pair.

##### Throws

PDFNetException |

#### public String getAsPDFText ()

Convert the SDF/Cos String object to 'PDF Text String' (a Unicode string). PDF Text Strings are not used to represent page content, however they are used in text annotations, bookmark names, article names, document information etc. These strings are encoded in either PDFDocEncoding or Unicode character encoding. For more information on PDF Text Strings, please refer to section 3.8.1 'Text Strings' in PDF Reference.

Note: Not all SDF/Cos String objects are used to represent 'PDF Text'. PDF Reference indicates (on a case by case basis ) where an SDF/Cos String object can be used as 'PDF Text'.

##### Returns

- the as pdf text

##### Throws

PDFNetException |

#### public Obj getAt (int index)

Get the Obj at specified index

##### Parameters

index | - The array element to obtain. The first element in an array has an index of zero.

##### Returns

- the at

##### Throws

PDFNetException |

#### public boolean getBool ()

Get the boolean value if Obj is bool

##### Returns

- bool value if this is bool.

##### Throws

PDFNetException |

#### public byte[] getBuffer ()

Get string buffer

Note: if SDF/Cos String object is represented as 'PDF Text' (Section 3.8.1 'Text Strings' in PDF Reference) you can use GetAsPDFText method to obtain Unicode representation of the string.

use Size() member function in order to obtain the number of bytes in string buffer.

##### Returns

- a pointer to the string buffer. Please note that the string may not be NULL terminated and that it may not be represented in ASCII or Unicode encoding. For more information on SDF/Cos String objects, please refer to section 3.2.3 'String Objects' in PDF Reference Manual.

##### Throws

PDFNetException |

#### public Filter getDecodedStream ()

Get the decoded stream.

##### Returns

- - A filter to the decoded stream

##### Throws

PDFNetException |

#### public DictIterator getDictIterator ()

Get the dictionary iterator.

##### Returns

- an iterator that addresses the first element in the dictionary.

##### Throws

PDFNetException | `DictIterator itr = dict.getDictIterator(); while (itr.hasCurrent()) { Obj key = itr.key(); Obj value = itr.value(); // ... itr.next()` }

#### public SDFDoc getDoc ()

Get the Doc object contains this Obj

Note: this method can be invoked on any Obj.

##### Returns

- the document to which this object belongs.

##### Throws

PDFNetException |

#### public short getGenNum ()

Get the generation number.

Note: this method can be invoked on any Obj.

##### Returns

- generation number. If this is not an Indirect object, generation number of a containing indirect object is returned.

##### Throws

PDFNetException |

#### public String getName ()

Get the string representation of the Name object

##### Returns

- string representation the Name object.

##### Throws

PDFNetException |

#### public double getNumber ()

Get the number value

##### Returns

- value, if this is Number.

##### Throws

PDFNetException |

#### public long getObjNum ()

Get the object number.

Note: this method can be invoked on any Obj.

##### Returns

- object number. If this is not an Indirect object, object number of a containing indirect object is returned.

##### Throws

PDFNetException |

#### public long getOffset ()

Get the offset from beginning of the file.

Note: this method can be invoked on any Obj.

##### Returns

- object offset from the beginning of the file. If this is not an Indirect object, offset of a containing indirect object is returned.

##### Throws

PDFNetException |

#### public byte[] getRawBuffer ()

Get an array containg the encrypted string buffer.

Note: Similar in behaviour to GetBuffer except that no decryption is done. If the file is not encrypted the result should be the same as GetBuffer

##### Throws

PDFNetException | Exception is thrown if this is not a Obj::Type::e_string.

#### public Filter getRawStream (boolean decrypt)

Get the raw stream.

##### Parameters

decrypt | - If true decrypt the stream if the stream is encrypted.

##### Returns

- - A filter to the encoded stream

##### Throws

PDFNetException |

#### public long getRawStreamLength ()

Get the raw stream length.

##### Returns

- the length of the raw/encoded stream equal to the Lenght parameter

##### Throws

PDFNetException |

#### public int getType ()

Get the Obj type.

Note: this method can be invoked on any Obj.

##### Returns

- the object type.

##### Throws

PDFNetException |

#### public Obj insert (int pos, Obj obj)

Inserts an existing Obj in this array.

##### Parameters

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.

##### Returns

- A newly inserted object.

##### Throws

PDFNetException |

#### public Obj insertArray (int pos)

Inserts an Obj::Type::e_array object in the array.

##### Parameters

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.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj insertBool (int pos, boolean value)

Inserts an Obj::Type::e_bool object in the array.

##### Parameters

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.

##### Returns

- A newly created boolean object.

##### Throws

PDFNetException |

#### public Obj insertDict (int pos)

Inserts an Obj::Type::e_dict object in the array.

##### Parameters

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.

##### Returns

- A newly created dictionary object.

##### Throws

PDFNetException |

#### public Obj insertMatrix (int pos, Matrix2D value)

Inserts an array of 6 numbers in this array.

##### Parameters

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.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj insertName (int pos, String name)

Inserts an Obj::Type::e_name object in the array.

##### Parameters

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.

##### Returns

- A newly created name object.

##### Throws

PDFNetException |

#### public Obj insertNull (int pos)

Inserts an Obj::Type::e_null object in the array.

##### Parameters

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.

##### Returns

- A newly created null object.

##### Throws

PDFNetException |

#### public Obj insertNumber (int pos, double value)

Inserts an Obj::Type::e_number object in the array.

##### Parameters

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.

##### Returns

- A newly created number object.

##### Throws

PDFNetException |

#### public Obj insertRect (int pos, double x1, double y1, double x2, double y2)

Inserts an array of 4 numbers in this array.

##### Parameters

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 x1
y1 | the y1
x2 | the x2
y2 | the y2

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj insertRect (int pos, Rectangle2D.Double rect)

Inserts an array of 4 numbers in this array.

##### Parameters

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.
rect | - The value for an array of four numbers to be inserted in this array.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj insertString (int pos, String value)

Inserts an Obj::Type::e_string object in the array.

##### Parameters

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.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public Obj insertString (int pos, byte[] value)

Inserts an Obj::Type::e_string object in the array.

##### Parameters

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.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public Obj insertText (int pos, String value)

Inserts an Obj::Type::e_string object in the array.

Note: InsertText will create the string object as a 'PDF Text' object.

##### Parameters

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.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public boolean isArray ()

Checks if Obj is an array.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is an Array, false otherwise.

##### Throws

PDFNetException |

#### public boolean isBool ()

Checks if Obj is Boolean object

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a boolean object, false otherwise.

##### Throws

PDFNetException |

#### public boolean isContainer ()

Checks if Obj is a container object.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Container (a dictionary, array, or a stream), false otherwise.

##### Throws

PDFNetException |

#### public boolean isDict ()

Checks if Obj is dictionary

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a dictionary (i.e. Dict), false otherwise.

##### Throws

PDFNetException |

#### public boolean isEqual (Obj to)

Checks if is equal to specified object

##### Parameters

to | the to

##### Returns

- true if two Obj pointers point to the same object. This method does not compare object content so you should not use this method to compare two (e.g. Number) objects

##### Throws

PDFNetException |

#### public boolean isFree ()

Checks if it is marked as free.

Note: this method can be invoked on any Obj.

##### Returns

- true if the object is in use or is marked as free.

##### Throws

PDFNetException |

#### public boolean isIndirect ()

Checks if Obj is an indirect object

Note: this method can be invoked on any Obj.

##### Returns

- true if this is an Indirect object (i.e. object referenced in the cross-reference table), false otherwise.

##### Throws

PDFNetException |

#### public boolean isLoaded ()

Checks if Obj is loaded.

Note: this method can be invoked on any Obj.

##### Returns

- true if the object is loaded in memory.

##### Throws

PDFNetException |

#### public boolean isMarked ()

Checks if Obj is marked.

Note: this method can be invoked on any Obj.

##### Returns

- true if the object is marked.

##### Throws

PDFNetException |

#### public boolean isName ()

Checks if Obj is a name object.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Name object, false otherwise.

##### Throws

PDFNetException |

#### public boolean isNull ()

Checks if is Obj null.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Null object, false otherwise.

##### Throws

PDFNetException |

#### public boolean isNumber ()

Checks if Obj is Number object.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Number object, false otherwise.

##### Throws

PDFNetException |

#### public boolean isStream ()

Checks if is a stream.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Stream, false otherwise.

##### Throws

PDFNetException |

#### public boolean isString ()

Checks if Obj is a string object.

Note: this method can be invoked on any Obj.

##### Returns

- true if this is a Str (String) object, false otherwise.

##### Throws

PDFNetException |

#### public Obj pushBack (Obj obj)

Appends an existing Obj at the end of the array.

##### Parameters

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.

##### Returns

- A newly appended object.

##### Throws

PDFNetException |

#### public Obj pushBackArray ()

Appends a new Obj::Type::e_array object at the end of the array.

##### Returns

- The new array object.

##### Throws

PDFNetException |

#### public Obj pushBackBool (boolean value)

Appends a new Obj::Type::e_bool object at the end of the array.

##### Parameters

value | the value

##### Returns

- The new boolean object.

##### Throws

PDFNetException |

#### public Obj pushBackDict ()

Appends a new Obj::Type::e_dict object at the end of the array.

##### Returns

- The new dictionary object.

##### Throws

PDFNetException |

#### public Obj pushBackMatrix (Matrix2D value)

Appends an array of 6 numbers at the end of the array.

##### Parameters

value | - A matrix used to set the values in an array of six numbers. The resulting array will be then inserted in this array.

##### Returns

- A newly appended array object.

##### Throws

PDFNetException |

#### public Obj pushBackName (String name)

Appends a new Obj::Type::e_name object at the end of the array.

##### Parameters

name | - The value of the Obj::Type::e_name object.

##### Returns

- The new array object.

##### Throws

PDFNetException |

#### public Obj pushBackNull ()

Appends a new Obj::Type::e_null object at the end of the array.

##### Returns

- The new null object.

##### Throws

PDFNetException |

#### public Obj pushBackNumber (double value)

Appends a new Obj::Type::e_number object at the end of the array.

##### Parameters

value | - The value of the Obj::Type::e_number object.

##### Returns

- The new number object.

##### Throws

PDFNetException |

#### public Obj pushBackRect (Rectangle2D.Double rect)

Appends an array of 4 numbers at the end of the array.

##### Parameters

rect | - The value for an array of four numbers to be appended.

##### Returns

- A newly appended array object.

##### Throws

PDFNetException |

#### public Obj pushBackRect (double x1, double y1, double x2, double y2)

Appends an array of 4 numbers at the end of the array.

##### Parameters

x1 | the x1
y1 | the y1
x2 | the x2
y2 | the y2

##### Returns

- A newly appended array object.

##### Throws

PDFNetException |

#### public Obj pushBackString (String value)

Appends a new Obj::Type::e_string object at the end of the array.

##### Parameters

value | - The value of the Obj::Type::e_string object.

##### Returns

- The new string object.

##### Throws

PDFNetException |

#### public Obj pushBackString (byte[] value)

Appends a new Obj::Type::e_string object at the end of the array.

##### Parameters

value | The buffer used to set the value of the Obj::Type::e_string object to be inserted.

##### Returns

- The new string object.

##### Throws

PDFNetException |

#### public Obj pushBackText (String value)

Appends a new Obj::Type::e_string object at the end of the array.

Note: InsertText will create the string object as a 'PDF Text' object.

##### Parameters

value | The value of the Obj::Type::e_string object to be inserted.

##### Returns

- The new string object.

##### Throws

PDFNetException |

#### public Obj put (String key, Obj obj)

Inserts a <key, Obj> pair in the dictionary.

##### Parameters

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.

##### Returns

- A newly inserted object.

##### Throws

PDFNetException |

#### public Obj putArray (String key)

Inserts a <key, Obj::Type::e_array> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj putBool (String key, boolean value)

Inserts a <key, Obj::Type::e_bool> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
value | The value of the Obj::Type::e_bool object to be inserted into the dictionary.

##### Returns

- A newly created boolean object.

##### Throws

PDFNetException |

#### public Obj putDict (String key)

Inserts a <key, Obj::Type::e_dict> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.

##### Returns

- A newly created dictionary.

##### Throws

PDFNetException |

#### public Obj putMatrix (String key, Matrix2D value)

Inserts a <key, [a,b,c,d,h,v]> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

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.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj putName (String key, String name)

Inserts a <key, Obj::Type::e_name> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
name | The value of the Obj::Type::e_name object to be inserted into the dictionary.

##### Returns

- A newly created name object.

##### Throws

PDFNetException |

#### public void putNull (String key)

Inserts a <key, Obj::Type::e_null> pair in the dictionary.

Note: The effect of calling this method is essentially the same as dict.Erase(key) .

##### Parameters

key | The key of the value to set.

##### Throws

PDFNetException |

#### public Obj putNumber (String key, double value)

Inserts a <key, Obj::Type::e_number> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
value | The value of the Obj::Type::e_number object to be inserted into the dictionary.

##### Returns

- A newly created number object.

##### Throws

PDFNetException |

#### public Obj putRect (String key, Rectangle2D.Double rect)

Inserts a <key, [x1,y1,x2,y2]> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
rect | - The values for an array of four numbers to be inserted into the dictionary.

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj putRect (String key, double x1, double y1, double x2, double y2)

Inserts a <key, [x1,y1,x2,y2]> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
x1 | the x1
y1 | the y1
x2 | the x2
y2 | the y2

##### Returns

- A newly created array object.

##### Throws

PDFNetException |

#### public Obj putString (String key, byte[] value)

Inserts a <key, Obj::Type::e_string> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

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.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public Obj putString (String key, String value)

Inserts a <key, Obj::Type::e_string> pair in the dictionary.

Note: If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
value | The value of the Obj::Type::e_string object to be inserted into the dictionary.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public Obj putText (String key, String value)

Inserts a <key, Obj::Type::e_string> pair in the dictionary.

Note: PutText will create the string object as a 'PDF Text' object.

If a dictionary already contains an entry with the same key, the old entry will be deleted and all DictIterators to this entry will be invalidated.

##### Parameters

key | The key of the value to set.
value | The value of the Obj::Type::e_string object to be inserted into the dictionary.

##### Returns

- A newly created string object.

##### Throws

PDFNetException |

#### public boolean rename (String old_key, String new_key)

Change the key value of a dictionary entry. The key can't be renamed if another key with the same name already exists in the dictionary. In this case Rename returns false.

##### Parameters

old_key | the old_key
new_key | the new_key

##### Returns

- true, if successful

##### Throws

PDFNetException |

#### public void setBool (boolean b)

Set the boolean value to Obj

##### Parameters

b | - bool value used to set Bool object.

##### Throws

PDFNetException |

#### public void setMark (boolean mark)

Set the object mark. Mark is a boolean value that can be associated with every indirect object. This is especially useful when and object graph should be traversed and an operation should be performed on each node only once.

Note: this method can be invoked on any Obj.

##### Parameters

mark | the new mark

##### Throws

PDFNetException |

#### public void setName (String name)

Set the name string

##### Parameters

name | - value used to set Name object.

##### Throws

PDFNetException |

#### public void setNumber (double n)

Set the number value

##### Parameters

n | - value used to set Number object.

##### Throws

PDFNetException |

#### public void setStreamData (byte[] data, Filter filter_chain)

Update a stream object with the new content.

##### Parameters

data | the character array with the new content stream
filter_chain | the filter_chain to be applied to the stream

##### Throws

PDFNetException |

#### public void setString (byte[] buf)

Set the string object value.

##### Parameters

buf | the new string buffer

##### Throws

PDFNetException |

#### public void setString (String value)

Set the string object value.

##### Parameters

value | the new string

##### Throws

PDFNetException |

#### public long size ()

Get size of Obj

Note: this method can be invoked on any Obj.

##### Returns

- the 'size' of the object. The definition of 'size' depends on the object type. In particular: - For a dictionary or a stream object, the method will return the number of key/value pairs in the dictionary. - For an array object the method will return the number of Obj enties in the array. - For a string object the method will return the number of bytes in the string buffer. - For any other object the method will always return 1.

##### Throws

PDFNetException |

#### public void write (FilterWriter stream)

The function writes the Obj to the output stream.

Note: this method can be invoked on any Obj.

##### Parameters

stream | - the input stream where the Obj will be written

##### Throws

PDFNetException |