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).
Implements
Inherited Members
Namespace: pdftron.SDF
Assembly: PDFTronDotNet.dll
Syntax
public class Obj : IDisposable
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Erase(string)
Removes an element in the dictionary that matches the given key.
Declaration
public void Erase(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | the key |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
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 |
EraseAt(int)
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 |
|---|---|---|
| int | pos | the pos |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
~Obj()
Releases all resources used by the Obj
Declaration
protected ~Obj()
Find(string)
Search the dictionary for a given key.
Declaration
public DictIterator Find(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|
| 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(int)
Gets the at.
Declaration
public Obj GetAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
|---|---|
| bool | 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 |
|---|---|
| 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 |
|---|---|
| int | 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 |
|---|---|
| IntPtr |
GetName()
Gets the name.
Declaration
public string GetName()
Returns
| Type | Description |
|---|---|
| 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 |
|---|---|
| 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 |
|---|---|
| int | 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 |
|---|---|
| int | 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 |
|---|---|
| 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(bool)
Gets the raw stream.
Declaration
public Filter GetRawStream(bool decrypt)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | 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 |
|---|---|
| int | 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 |
|---|---|
| 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(int, Obj)
Inserts an existing Obj in this array.
Declaration
public Obj Insert(int pos, Obj obj)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Inserts an Obj.Type.e_array object in the array.
Declaration
public Obj InsertArray(int pos)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
Returns
| Type | Description |
|---|---|
| Obj | A newly created array object. |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
InsertBool(int, bool)
Inserts an Obj.Type.e_bool object in the array.
Declaration
public Obj InsertBool(int pos, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| bool | 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(int)
Inserts an Obj.Type.e_dict object in the array.
Declaration
public Obj InsertDict(int pos)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
Returns
| Type | Description |
|---|---|
| Obj | A newly created dictionary object. |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
InsertMatrix(int, Matrix2D)
Inserts an array of 6 numbers in this array.
Declaration
public Obj InsertMatrix(int pos, Matrix2D value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| Matrix2D | value |
|
Returns
| Type | Description |
|---|---|
| Obj | A newly created array object. |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
InsertName(int, string)
Inserts an Obj.Type.e_name object in the array.
Declaration
public Obj InsertName(int pos, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| 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(int)
Inserts an Obj.Type.e_null object in the array.
Declaration
public Obj InsertNull(int pos)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
Returns
| Type | Description |
|---|---|
| Obj | A newly created null object. |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
InsertNumber(int, double)
Inserts an Obj.Type.e_number object in the array.
Declaration
public Obj InsertNumber(int pos, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| 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(int, 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 |
|---|---|---|
| int | pos |
|
| double | x1 | the x1 |
| double | y1 | the y1 |
| double | x2 | the x2 |
| double | y2 | the y2 |
Returns
| Type | Description |
|---|---|
| Obj | A newly created array object. |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
InsertString(int, byte[])
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertString(int pos, byte[] buf)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| 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(int, string)
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertString(int pos, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| 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(int, string)
Inserts an Obj.Type.e_string object in the array.
Declaration
public Obj InsertText(int pos, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pos |
|
| 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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(bool)
Appends a new Obj.Type.e_bool object at the end of the array.
Declaration
public Obj PushBackBool(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| double | x1 | the x1 |
| double | y1 | the y1 |
| double | x2 | the x2 |
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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, bool)
Inserts a <key, Obj.Type.e_bool> pair in the dictionary.
Declaration
public Obj PutBool(string key, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the value to set. |
| bool | 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| double | x1 | the x1 |
| double | y1 | the y1 |
| double | x2 | the x2 |
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| 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 |
|---|---|---|
| string | key | The key of the value to set. |
| 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 |
|---|---|---|
| string | old_key | the old_key |
| string | new_key | the new_key |
Returns
| Type | Description |
|---|---|
| bool | true, if successful |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
SetBool(bool)
Sets the bool.
Declaration
public void SetBool(bool b)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | b |
|
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
SetMark(bool)
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 |
|---|---|---|
| bool | 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| 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 |
|---|---|---|
| string | str | the new string |
Exceptions
| Type | Condition |
|---|---|
| PDFNetException | PDFNetException the PDFNet exception |
Size()
Size.
Declaration
public int Size()
Returns
| Type | Description |
|---|---|
| int | 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
operator ==(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 |
|---|---|
| bool | true if both objects are equals, false otherwise |
operator !=(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 |
|---|---|
| bool | true if both objects are not equals, false otherwise |