Foxit PDF SDK

Public Member Functions | Static Public Member Functions | List of all members
foxit.pdf.objects.PDFDictionary Class Reference
Inheritance diagram for foxit.pdf.objects.PDFDictionary:

## Public Member Functions
PDFObject | GetElement (string key)
| Get the value element of an entry with specified key. More...
string | GetKey (long position)
| Get the key of an entry specified by position. More...
PDFObject | GetValue (long position)
| Get the value element of an entry specified by position. More...
bool | HasKey (string key)
| Check whether there is an entry with specified key in current dictionary or not. More...
long | MoveNext (long position)
| Move to the position of first or the next entry. More...
void | RemoveAt (string key)
| Remove an entry specified by key. More...
void | SetAt (string key, PDFObject pdf_object)
| Set a direct PDF object (whose object number is always equal to 0) as value element to an entry specified by key. More...
void | SetAtBoolean (string key, bool value)
| Set boolean element an entry specified by key. More...
void | SetAtDateTime (string key, DateTime value)
| Set a Datetime object as value element to an entry specified by key. More...
void | SetAtFloat (string key, float value)
| Set a float element to an entry specified by key. More...
void | SetAtInteger (string key, int value)
| Set a integer element to an entry specified by key. More...
void | SetAtMatrix (string key, Matrix2D value)
| Set a matrix object as value element to an entry specified by key. More...
void | SetAtName (string key, string value)
| Set a string (as PDF name object) as value element to an entry specified by key. More...
void | SetAtRect (string key, RectF value)
| Set a rectangle object as value element to an entry specified by key. More...
void | SetAtReference (string key, PDFObject pdf_object, PDFDoc document)
| Set the reference object of an indirect PDF object (whose object number is always above 0) as value element to an entry specified by key. More...
void | SetAtString (string key, string value)
| Set a string as value element to an entry specified by key. More...
Public Member Functions inherited from foxit.pdf.objects.PDFObject
PDFObject | CloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
PDFObject | DeepCloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
PDFArray | GetArray ()
| Get the PDF array object of current PDF object. More...
bool | GetBoolean ()
| Get the boolean value of current PDF object. More...
DateTime | GetDateTime ()
| Get the date time value of current PDF object. More...
PDFDictionary | GetDict ()
| Get the PDF dictionary object of current PDF object. More...
PDFObject | GetDirectObject ()
| Get the direct object of current PDF object. More...
float | GetFloat ()
| Get the float value of current PDF object. More...
int | GetInteger ()
| Get the integer value of current PDF object. More...
Matrix2D | GetMatrix ()
| Get the matrix value of current PDF object. More...
string | GetName ()
| Get the name value of current PDF object. More...
int | GetObjNum ()
| Get the indirect object number of current PDF object. More...
RectF | GetRect ()
| Get the rectangle value of current PDF object. More...
PDFStream | GetStream ()
| Get the PDF stream object of current PDF object. More...
byte [] | GetString ()
| Get the string value of current PDF object. More...
PDFObject.Type | GetType ()
| Get the type of current PDF object. More...
string | GetWideString ()
| Get the wide string value of current PDF object. More...
bool | IsIdentical (PDFObject pdf_obj)
| Check if input PDF object is identical with current PDF object. More...
void | Release ()
| Release a newly created PDF object or a clone PDF object, which is not related to PDF document or other PDF object and will not be used any more. More...

## Static Public Member Functions
static PDFDictionary | Create ()
| Create a new dictionary object. More...
Static Public Member Functions inherited from foxit.pdf.objects.PDFObject
static PDFObject | CreateFromBoolean (bool boolean_value)
| Create a PDF object from a boolean value. More...
static PDFObject | CreateFromDateTime (DateTime date_time)
| Create a PDF object from date time. More...
static PDFObject | CreateFromFloat (float float_value)
| Create a PDF object from a float number. More...
static PDFObject | CreateFromInteger (int integer_value)
| Create a PDF object from a integer number. More...
static PDFObject | CreateFromName (string name)
| Create a PDF object from a string which represents a name. More...
static PDFObject | CreateFromNameW (string name)
| Create a PDF object from a string which represents a name. More...
static PDFObject | CreateFromString (string string_value)
| Create a PDF object from string. More...
static PDFObject | CreateFromString (string string_value, int length)
| Create a PDF object from string. More...
static PDFObject | CreateReference (PDFDoc document, int object_number)
| Create a reference for an indirect object. More...

## Additional Inherited Members
Public Types inherited from foxit.pdf.objects.PDFObject
enum | Type { Type.e_InvalidType = 0, Type.e_Boolean = 1, Type.e_Number = 2, Type.e_String = 3, Type.e_Name = 4, Type.e_Array = 5, Type.e_Dictionary = 6, Type.e_Stream = 7, Type.e_Null = 8, Type.e_Reference = 9 }
| Enumeration for PDF object type. More...

## Detailed Description

A PDF dictionary object is an associative table containing pairs of objects, known as entries of the dictionary. The first element of each entry is the key, and it must be a PDF name object. The second element is the value, and it can be any kind of PDF object, including another dictionary. In the same dictionary, no two entries should have the same key. For more details, please refer to Section 3.2.6 "Dictionary Objects" in <PDF Reference 1.7>.
Class foxit.pdf.objects.PDFDictionary is derived from PDFObject and offers functions to create a new PDF dictionary object and get/set entries in a PDF dictionary object.

See also
  PDFObject

## Member Function Documentation

## ◆ Create()

static PDFDictionary foxit.pdf.objects.PDFDictionary.Create | ( |  | ) |
| inline static

Create a new dictionary object.

Please call function PDFObject.Release to release the created object if it has not been added/set into PDF document or other PDF object and will not be used any more.

Returns
  A new PDFDictionary object. If there is any error, this function will return null.

## ◆ GetElement()

PDFObject foxit.pdf.objects.PDFDictionary.GetElement | ( | string | key | ) |
| inline

Get the value element of an entry with specified key.

Parameters

  [in] | key | The key of the entry. It should not be an empty string.

Returns
  A PDFObject object that receives the value with specified key. If not found, this function will return null.

## ◆ GetKey()

string foxit.pdf.objects.PDFDictionary.GetKey | ( | long | position | ) |
| inline

Get the key of an entry specified by position.

Parameters

  [in] | position | A POSITION that specifies the position of the entry. It should not be null or 0.

Returns
  The key of the specified entry.

## ◆ GetValue()

PDFObject foxit.pdf.objects.PDFDictionary.GetValue | ( | long | position | ) |
| inline

Get the value element of an entry specified by position.

Parameters

  [in] | position | A POSITION that specifies the position of the entry. It should not be null or 0.

Returns
  A PDFObject that receives the value element of the specified entry. If there is any error, this function will return null.

## ◆ HasKey()

bool foxit.pdf.objects.PDFDictionary.HasKey | ( | string | key | ) |
| inline

Check whether there is an entry with specified key in current dictionary or not.

Parameters

  [in] | key | The key to be checked. It should not be an empty string.

Returns
  true means the specified key exist in current dictionary, while false means not.

## ◆ MoveNext()

long foxit.pdf.objects.PDFDictionary.MoveNext | ( | long | position | ) |
| inline

Move to the position of first or the next entry.

Parameters

  [in] | position | A POSITION that indicates the position of current entry in the dictionary. If this is null or 0, the position of first entry in the dictionary will be returned.

Returns
  A POSITION that represents the position of next entry in the dictionary. null or 0 means current entry is the last in the dictionary.

## ◆ RemoveAt()

void foxit.pdf.objects.PDFDictionary.RemoveAt | ( | string | key | ) |
| inline

Remove an entry specified by key.

Parameters

  [in] | key | The key of the entry to be removed. It should not be an empty string.

Returns
  None.

## ◆ SetAt()

void foxit.pdf.objects.PDFDictionary.SetAt | ( | string | key,
|  | PDFObject | pdf_object
| ) |  |
| inline

Set a direct PDF object (whose object number is always equal to 0) as value element to an entry specified by key.

If user wants to set indirect PDF object (whose object number is always above 0) to an entry, please refer to function PDFDictionary.SetAtReference .

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | pdf_object | A PDFObject object which is a direct PDF object (whose object number is always equal to 0) and will be set to the entry. It should not be null.

Returns
  None.

## ◆ SetAtBoolean()

void foxit.pdf.objects.PDFDictionary.SetAtBoolean | ( | string | key,
|  | bool | value
| ) |  |
| inline

Set boolean element an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A boolean element which will be set to the entry.

Returns
  None.

## ◆ SetAtDateTime()

void foxit.pdf.objects.PDFDictionary.SetAtDateTime | ( | string | key,
|  | DateTime | value
| ) |  |
| inline

Set a Datetime object as value element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | The date time information which will be set to the entry.

Returns
  None.

## ◆ SetAtFloat()

void foxit.pdf.objects.PDFDictionary.SetAtFloat | ( | string | key,
|  | float | value
| ) |  |
| inline

Set a float element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A float value which will be set to the entry.

Returns
  None.

## ◆ SetAtInteger()

void foxit.pdf.objects.PDFDictionary.SetAtInteger | ( | string | key,
|  | int | value
| ) |  |
| inline

Set a integer element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | An integer value which will be set to the entry.

Returns
  None.

## ◆ SetAtMatrix()

void foxit.pdf.objects.PDFDictionary.SetAtMatrix | ( | string | key,
|  | Matrix2D | value
| ) |  |
| inline

Set a matrix object as value element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A matrix which will be set to the entry.

Returns
  None.

## ◆ SetAtName()

void foxit.pdf.objects.PDFDictionary.SetAtName | ( | string | key,
|  | string | value
| ) |  |
| inline

Set a string (as PDF name object) as value element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A string which will be set as PDF name object to the entry. It should not be an empty string.

Returns
  None.

## ◆ SetAtRect()

void foxit.pdf.objects.PDFDictionary.SetAtRect | ( | string | key,
|  | RectF | value
| ) |  |
| inline

Set a rectangle object as value element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A rectangle which will be set to the entry.

Returns
  None.

## ◆ SetAtReference()

void foxit.pdf.objects.PDFDictionary.SetAtReference | ( | string | key,
|  | PDFObject | pdf_object,
|  | PDFDoc | document
| ) |  |
| inline

Set the reference object of an indirect PDF object (whose object number is always above 0) as value element to an entry specified by key.

If user wants to set direct PDF object (whose object number is always equal to 0) to an entry, please refer to function PDFDictionary.SetAt .

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | pdf_object | A PDFObject object which is an indirect PDF object (whose object number is always above 0) and will be set to the entry by a reference object which refers to this indirect object. It should not be null.
  [in] | document | A valid PDF document object, to which current PDF dictionary object belongs and in which parameter pdf_object is or will be an indirect object.

Returns
  None.

## ◆ SetAtString()

void foxit.pdf.objects.PDFDictionary.SetAtString | ( | string | key,
|  | string | value
| ) |  |
| inline

Set a string as value element to an entry specified by key.

Parameters

  [in] | key | The key of the entry, whose value element will be set. It should not be an empty string.
  [in] | value | A wide string which will be set as PDF string object to the entry.

Returns
  None.

Note
  If to get string value, please call function PDFObject.GetWideString .