Foxit PDF RDK

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

## Public Member Functions
| GetElement (key)
| Get the value element of an entry with specified key. More...
| GetKey (position)
| Get the key of an entry specified by position. More...
| GetValue (position)
| Get the value element of an entry specified by position. More...
| HasKey (key)
| Check whether there is an entry with specified key in current dictionary or not. More...
| MoveNext (position)
| Move to the position of first or the next entry. More...
| RemoveAt (key)
| Remove an entry specified by key. More...
| SetAt (key, 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...
| SetAtBoolean (key, value)
| Set boolean element an entry specified by key. More...
| SetAtDateTime (key, value)
| Set a Datetime object as value element to an entry specified by key. More...
| SetAtFloat (key, value)
| Set a float element to an entry specified by key. More...
| SetAtInteger (key, value)
| Set a integer element to an entry specified by key. More...
| SetAtMatrix (key, value)
| Set a matrix object as value element to an entry specified by key. More...
| SetAtName (key, value)
| Set a string (as PDF name object) as value element to an entry specified by key. More...
| SetAtRect (key, value)
| Set a rectangle object as value element to an entry specified by key. More...
| SetAtReference (key, pdf_object, 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...
| SetAtString (key, value)
| Set a string as value element to an entry specified by key. More...
Public Member Functions inherited from PDFObject
| CloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
| DeepCloneObject ()
| Clone current PDF object and get the cloned PDF object. More...
| GetArray ()
| Get the PDF array object of current PDF object. More...
| GetBoolean ()
| Get the boolean value of current PDF object. More...
| GetDateTime ()
| Get the date time value of current PDF object. More...
| GetDict ()
| Get the PDF dictionary object of current PDF object. More...
| GetDirectObject ()
| Get the direct object of current PDF object. More...
| GetFloat ()
| Get the float value of current PDF object. More...
| GetInteger ()
| Get the integer value of current PDF object. More...
| GetMatrix ()
| Get the matrix value of current PDF object. More...
| GetName ()
| Get the name value of current PDF object. More...
| GetObjNum ()
| Get the indirect object number of current PDF object. More...
| GetRect ()
| Get the rectangle value of current PDF object. More...
| GetStream ()
| Get the PDF stream object of current PDF object. More...
| GetString ()
| Get the string value of current PDF object. More...
| GetType ()
| Get the type of current PDF object. More...
| GetWideString ()
| Get the wide string value of current PDF object. More...
| IsIdentical (pdf_obj)
| Check if input PDF object is identical with current PDF object. More...
| 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...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

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

## Additional Inherited Members
Static Public Attributes inherited from PDFObject
static | e_Array
| PDF array object.
static | e_Boolean
| PDF boolean object.
static | e_Dictionary
| PDF dictionary object.
static | e_InvalidType
| Enumeration for PDF object type. More...
static | e_Name
| PDF name object.
static | e_Null
| PDF null object.
static | e_Number
| PDF number object.
static | e_Reference
| PDF reference object.
static | e_Stream
| PDF stream object.
static | e_String
| PDF string object.

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

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Function Documentation

## ◆ Create()

static PDFDictionary.Create | ( |  | ) |
| 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()

PDFDictionary.GetElement | ( | key |  | ) |

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()

PDFDictionary.GetKey | ( | position |  | ) |

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()

PDFDictionary.GetValue | ( | position |  | ) |

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()

PDFDictionary.HasKey | ( | key |  | ) |

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()

PDFDictionary.MoveNext | ( | position |  | ) |

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()

PDFDictionary.RemoveAt | ( | key |  | ) |

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()

PDFDictionary.SetAt | ( | key | ,
|  | pdf_object |
| ) |  |

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()

PDFDictionary.SetAtBoolean | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtDateTime | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtFloat | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtInteger | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtMatrix | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtName | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtRect | ( | key | ,
|  | value |
| ) |  |

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()

PDFDictionary.SetAtReference | ( | key | ,
|  | pdf_object | ,
|  | 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.

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()

PDFDictionary.SetAtString | ( | key | ,
|  | value |
| ) |  |

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 string which will be set as PDF string object to the entry.

Returns
  None.

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