Class Obj
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).
Inheritance
Implements
Inherited Members
Namespace: pdftron.SDF
Assembly: PDFNetAndroid.dll
Syntax
public class Obj : IDisposable
Methods
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Erase(DictIterator)
Removes an element in the dictionary from specified position.
Declaration
public void Erase(DictIterator pos)
Parameters
Type | Name | Description |
---|---|---|
DictIterator | pos | the pos |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Erase(String)
Removes an element in the dictionary that matches the given key.
Declaration
public void Erase(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
EraseAt(Int32)
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.
Declaration
public void EraseAt(int pos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos | the pos |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Finalize()
Releases all resources used by the Obj
Declaration
protected void Finalize()
Find(String)
Search the dictionary for a given key.
Declaration
public DictIterator Find(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
|
Returns
Type | Description |
---|---|
DictIterator | The iterator to the matching key/value pair or invalid iterator (i.e. itr.hasNext()==fase) if the if the dictionary does not contain the given key. |
Remarks
A dictionary entry whose value is Obj.Null is equivalent to an absent entry.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
FindObj(String)
Search the dictionary for a given key.
Declaration
public Obj FindObj(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
|
Returns
Type | Description |
---|---|
Obj | NULL if the dictionary does not contain the specified key. Otherwise return the corresponding value. |
Remarks
A dictionary entry whose value is Obj.Null is equivalent to an absent entry.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Get(String)
Search the dictionary for a given key and throw an exception if the key is not found.
Declaration
public DictIterator Get(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
|
Returns
Type | Description |
---|---|
DictIterator | Obj.Null object if the value matching specified key is a Obj.Null object. otherwise return the interator to the matching key/value pair. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
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.
Declaration
public string GetAsPDFText()
Returns
Type | Description |
---|---|
System.String | the as pdf text |
Remarks
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'.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetAt(Int32)
Gets the at.
Declaration
public Obj GetAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
|
Returns
Type | Description |
---|---|
Obj | the at |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetBool()
Gets the bool.
Declaration
public bool GetBool()
Returns
Type | Description |
---|---|
System.Boolean | bool value if this is Bool. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetBuffer()
Gets the buffer.
Declaration
public byte[] GetBuffer()
Returns
Type | Description |
---|---|
System.Byte[] | 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. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetDecodedStream()
Gets the decoded stream.
Declaration
public Filter GetDecodedStream()
Returns
Type | Description |
---|---|
Filter |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetDictIterator()
Gets the dict iterator.
Declaration
public DictIterator GetDictIterator()
Returns
Type | Description |
---|---|
DictIterator | an iterator that addresses the first element in the dictionary. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetDoc()
Gets the doc.
Declaration
public SDFDoc GetDoc()
Returns
Type | Description |
---|---|
SDFDoc | the document to which this object belongs. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetGenNum()
Gets the gen num.
Declaration
public int GetGenNum()
Returns
Type | Description |
---|---|
System.Int32 | generation number. If this is not an Indirect object, generation number of a containing indirect object is returned. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetHandleInternal()
Declaration
public IntPtr GetHandleInternal()
Returns
Type | Description |
---|---|
System.IntPtr |
GetName()
Gets the name.
Declaration
public string GetName()
Returns
Type | Description |
---|---|
System.String | string representing the Name object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetNumber()
Gets the number.
Declaration
public double GetNumber()
Returns
Type | Description |
---|---|
System.Double | value, if this is Number. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetObjNum()
Gets the obj num.
Declaration
public int GetObjNum()
Returns
Type | Description |
---|---|
System.Int32 | object number. If this is not an Indirect object, object number of a containing indirect object is returned. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetOffset()
Gets the offset.
Declaration
public int GetOffset()
Returns
Type | Description |
---|---|
System.Int32 | object offset from the beginning of the file. If this is not an Indirect object, offset of a containing indirect object is returned. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetRawBuffer()
Gets the buffer.
Declaration
public byte[] GetRawBuffer()
Returns
Type | Description |
---|---|
System.Byte[] | An array containing the unencrypted string data |
Remarks
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
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetRawStream(Boolean)
Gets the raw stream.
Declaration
public Filter GetRawStream(bool decrypt)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | decrypt |
|
Returns
Type | Description |
---|---|
Filter |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetRawStreamLength()
Gets the raw stream length.
Declaration
public int GetRawStreamLength()
Returns
Type | Description |
---|---|
System.Int32 | the length of the raw/encoded stream equal to the Lenght parameter |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetRefHandleInternal()
Declaration
public object GetRefHandleInternal()
Returns
Type | Description |
---|---|
System.Object |
GetType()
Gets the type.
Declaration
public Obj.ObjType GetType()
Returns
Type | Description |
---|---|
Obj.ObjType | the object type. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Insert(Int32, Obj)
Inserts an existing Obj in this array.
Declaration
public Obj Insert(int pos, Obj obj)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
Obj | 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
Type | Description |
---|---|
Obj | A newly inserted object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertArray(Int32)
Inserts an Obj.Type.e_array
object in the array.
Declaration
public Obj InsertArray(int pos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertBool(Int32, Boolean)
Inserts an Obj.Type.e_bool
object in the array.
Declaration
public Obj InsertBool(int pos, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.Boolean | value | The value of the Obj.Type.e_bool object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created boolean object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertDict(Int32)
Inserts an Obj.Type.e_dict object in the array.
Declaration
public Obj InsertDict(int pos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
Returns
Type | Description |
---|---|
Obj | A newly created dictionary object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertMatrix(Int32, Matrix2D)
Inserts an array of 6 numbers in this array.
Declaration
public Obj InsertMatrix(int pos, Matrix2D value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
Matrix2D | value |
|
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertName(Int32, String)
Inserts an Obj.Type.e_name object in the array.
Declaration
public Obj InsertName(int pos, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.String | name | The value of the Obj.Type.e_name object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created name object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertNull(Int32)
Inserts an Obj.Type.e_null object in the array.
Declaration
public Obj InsertNull(int pos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
Returns
Type | Description |
---|---|
Obj | A newly created null object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertNumber(Int32, Double)
Inserts an Obj.Type.e_number object in the array.
Declaration
public Obj InsertNumber(int pos, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.Double | value | The value of the Obj.Type.e_number object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created number object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertRect(Int32, Double, Double, Double, Double)
Inserts an array of 4 numbers in this array.
Declaration
public Obj InsertRect(int pos, double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.Double | x1 | the x1 |
System.Double | y1 | the y1 |
System.Double | x2 | the x2 |
System.Double | y2 | the y2 |
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertString(Int32, Byte[])
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertString(int pos, byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.Byte[] | buf | The buffer used to set the value of the Obj.Type.e_string object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertString(Int32, String)
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertString(int pos, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.String | value | The value of the Obj.Type.e_string object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
InsertText(Int32, String)
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertText(int pos, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pos |
|
System.String | value | The value of the Obj.Type.e_string object to be inserted. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Remarks
InsertText will create the string object as a 'PDF Text' object.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsArray()
Checks if is array.
Declaration
public bool IsArray()
Returns
Type | Description |
---|---|
System.Boolean | true if this is an Array, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsBool()
Checks if is bool.
Declaration
public bool IsBool()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Bool object, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsContainer()
Checks if is container.
Declaration
public bool IsContainer()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Container (a dictionary, array, or a stream), false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsDict()
Checks if is dict.
Declaration
public bool IsDict()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a dictionary (i.e. Dict), false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsEqual(Obj)
Checks if is equal.
Declaration
public bool IsEqual(Obj to)
Parameters
Type | Name | Description |
---|---|---|
Obj | to | the to |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsFree()
Checks if is free.
Declaration
public bool IsFree()
Returns
Type | Description |
---|---|
System.Boolean | true if the object is in use or is marked as free. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsIndirect()
Checks if is indirect.
Declaration
public bool IsIndirect()
Returns
Type | Description |
---|---|
System.Boolean | true if this is Indirect object (i.e. object referenced in the cross-reference table), false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsLoaded()
Checks if is loaded.
Declaration
public bool IsLoaded()
Returns
Type | Description |
---|---|
System.Boolean | true if the object is loaded in memory. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsMarked()
Checks if is marked.
Declaration
public bool IsMarked()
Returns
Type | Description |
---|---|
System.Boolean | true if the object is marked. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsName()
Checks if is name.
Declaration
public bool IsName()
Returns
Type | Description |
---|---|
System.Boolean | true if this is Name, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsNull()
Checks if is null.
Declaration
public bool IsNull()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Null object, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsNumber()
Checks if is number.
Declaration
public bool IsNumber()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Number object, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsStream()
Checks if is stream.
Declaration
public bool IsStream()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Stream, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsString()
Checks if is string.
Declaration
public bool IsString()
Returns
Type | Description |
---|---|
System.Boolean | true if this is a Str (string) object, false otherwise. |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBack(Obj)
Appends an existing Obj at the end of the array.
Declaration
public Obj PushBack(Obj obj)
Parameters
Type | Name | Description |
---|---|---|
Obj | 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
Type | Description |
---|---|
Obj | A newly appended object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackArray()
Appends a new Obj.Type.e_array object at the end of the array.
Declaration
public Obj PushBackArray()
Returns
Type | Description |
---|---|
Obj | The new array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackBool(Boolean)
Appends a new Obj.Type.e_bool object at the end of the array.
Declaration
public Obj PushBackBool(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | the value |
Returns
Type | Description |
---|---|
Obj | The new boolean object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackDict()
Appends a new Obj.Type.e_dict object at the end of the array.
Declaration
public Obj PushBackDict()
Returns
Type | Description |
---|---|
Obj | The new dictionary object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackMatrix(Matrix2D)
Appends an array of 6 numbers at the end of the array.
Declaration
public Obj PushBackMatrix(Matrix2D value)
Parameters
Type | Name | Description |
---|---|---|
Matrix2D | value |
|
Returns
Type | Description |
---|---|
Obj | A newly appended array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackName(String)
Appends a new Obj.Type.e_name object at the end of the array.
Declaration
public Obj PushBackName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
|
Returns
Type | Description |
---|---|
Obj | The new array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackNull()
Appends a new Obj.Type.e_null object at the end of the array.
Declaration
public Obj PushBackNull()
Returns
Type | Description |
---|---|
Obj | The new null object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackNumber(Double)
Appends a new Obj.Type.e_number object at the end of the array.
Declaration
public Obj PushBackNumber(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value |
|
Returns
Type | Description |
---|---|
Obj | The new number object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackRect(Double, Double, Double, Double)
Appends an array of 4 numbers at the end of the array.
Declaration
public Obj PushBackRect(double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x1 | the x1 |
System.Double | y1 | the y1 |
System.Double | x2 | the x2 |
System.Double | y2 | the y2 |
Returns
Type | Description |
---|---|
Obj | A newly appended array object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackString(Byte[])
Appends a new Obj.Type.e_string object at the end of the array.
Declaration
public Obj PushBackString(byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buf | The buffer used to set the value of the Obj.Type.e_string object to be inserted. |
Returns
Type | Description |
---|---|
Obj | The new string object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackString(String)
Appends a new Obj.Type.e_string object at the end of the array.
Declaration
public Obj PushBackString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
|
Returns
Type | Description |
---|---|
Obj | The new string object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PushBackText(String)
Appends a new Obj.Type.e_string object at the end of the array.
Declaration
public Obj PushBackText(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value of the Obj.Type.e_string object to be inserted. |
Returns
Type | Description |
---|---|
Obj | The new string object. |
Remarks
InsertText will create the string object as a 'PDF Text' object.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Put(String, Obj)
Inserts a <key, Obj>
pair in the dictionary.
Declaration
public Obj Put(string key, Obj obj)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
Obj | 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
Type | Description |
---|---|
Obj | A newly inserted object. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutArray(String)
Inserts a <key, Obj.Type.e_array>
pair in the dictionary.
Declaration
public Obj PutArray(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutBool(String, Boolean)
Inserts a <key, Obj.Type.e_bool>
pair in the dictionary.
Declaration
public Obj PutBool(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.Boolean | value | The value of the Obj.Type.e_bool object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created boolean object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutDict(String)
Inserts a <key, Obj.Type.e_dict>
pair in the dictionary.
Declaration
public Obj PutDict(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
Returns
Type | Description |
---|---|
Obj | A newly created dictionary. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutMatrix(String, Matrix2D)
Inserts a <key, [a,b,c,d,h,v]>
pair in the dictionary.
Declaration
public Obj PutMatrix(string key, Matrix2D value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
Matrix2D | value |
|
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutName(String, String)
Inserts a <key, Obj.Type.e_name>
pair in the dictionary.
Declaration
public Obj PutName(string key, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.String | name | The value of the Obj.Type.e_name object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created name object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutNull(String)
Inserts a <key, Obj.Type.e_null>
pair in the dictionary.
Declaration
public void PutNull(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
Remarks
The effect of calling this method is essentially the same as dict.Erase(key) .
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutNumber(String, Double)
Inserts a <key, Obj.Type.e_number>
pair in the dictionary.
Declaration
public Obj PutNumber(string key, double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.Double | value | The value of the Obj.Type.e_number object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created number object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutRect(String, Double, Double, Double, Double)
Inserts a <key, [x1,y1,x2,y2]>
pair in the dictionary.
Declaration
public Obj PutRect(string key, double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.Double | x1 | the x1 |
System.Double | y1 | the y1 |
System.Double | x2 | the x2 |
System.Double | y2 | the y2 |
Returns
Type | Description |
---|---|
Obj | A newly created array object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutString(String, Byte[])
Inserts a <key, Obj.Type.e_string>
pair in the dictionary.
Declaration
public Obj PutString(string key, byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.Byte[] | buf | The buffer used to set the value of the Obj.Type.e_string object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutString(String, String)
Inserts a <key, Obj.Type.e_string>
pair in the dictionary.
Declaration
public Obj PutString(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.String | value | The value of the Obj.Type.e_string object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PutText(String, String)
Inserts a <key, Obj.Type.e_string>
pair in the dictionary.
Declaration
public Obj PutText(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to set. |
System.String | value | The value of the Obj.Type.e_string object to be inserted into the dictionary. |
Returns
Type | Description |
---|---|
Obj | A newly created string object. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Rename(String, String)
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.
Declaration
public bool Rename(string old_key, string new_key)
Parameters
Type | Name | Description |
---|---|---|
System.String | old_key | the old_key |
System.String | new_key | the new_key |
Returns
Type | Description |
---|---|
System.Boolean | true, if successful |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetBool(Boolean)
Sets the bool.
Declaration
public void SetBool(bool b)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | b |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetMark(Boolean)
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.
Declaration
public void SetMark(bool mark)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | mark | the new mark |
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetName(String)
Sets the name.
Declaration
public void SetName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetNumber(Double)
Sets the number.
Declaration
public void SetNumber(double n)
Parameters
Type | Name | Description |
---|---|---|
System.Double | n |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetStreamData(Byte[])
allows to replace the content stream with a new one without creating a new object
Declaration
public void SetStreamData(byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buf | buffer contain new content stream |
SetStreamData(Byte[], Filter)
allows to replace the content stream with a new one without creating a new object
Declaration
public void SetStreamData(byte[] buf, Filter filter)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buf | buffer contain new content stream |
Filter | filter |
SetString(Byte[])
Sets the string object value.
Declaration
public void SetString(byte[] buf)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buf | the new string |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetString(String)
Sets the string object value.
Declaration
public void SetString(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | the new string |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Size()
Size.
Declaration
public int Size()
Returns
Type | Description |
---|---|
System.Int32 | the 'size' of the object. The definition of 'size' depends on the object type. In particular:
|
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Write(FilterWriter)
The function writes the Obj to the output stream.
Declaration
public void Write(FilterWriter stream)
Parameters
Type | Name | Description |
---|---|---|
FilterWriter | stream |
|
Remarks
this method can be invoked on any Obj.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Operators
Equality(Obj, Obj)
Equality operator checks whether two Obj
objects are the same.
Declaration
public static bool operator ==(Obj lhs, Obj rhs)
Parameters
Type | Name | Description |
---|---|---|
Obj | lhs |
|
Obj | rhs |
|
Returns
Type | Description |
---|---|
System.Boolean | true if both objects are equals, false otherwise |
Inequality(Obj, Obj)
Inequality operator checks whether two Obj
objects are different.
Declaration
public static bool operator !=(Obj lhs, Obj rhs)
Parameters
Type | Name | Description |
---|---|---|
Obj | lhs |
|
Obj | rhs |
|
Returns
Type | Description |
---|---|
System.Boolean | true if both objects are not equals, false otherwise |