Foxit PDF SDK
fsdk.PDFDictionary Class Reference

Public Member Functions

def GetElement (key)
 Get the value element of an entry with specified key.
More...
 
def GetKey (position)
 Get the key of an entry specified by position.
More...
 
def GetValue (position)
 Get the value element of an entry specified by position.
More...
 
def HasKey (key)
 Check whether there is an entry with specified key in current dictionary or not.
More...
 
def MoveNext (position)
 Move to the position of first or the next entry.
More...
 
def RemoveAt (key)
 Remove an entry specified by key.
More...
 
def 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...
 
def SetAtBoolean (key, value)
 Set boolean element an entry specified by key.
More...
 
def SetAtDateTime (key, value)
 Set a Datetime object as value element to an entry specified by key.
More...
 
def SetAtFloat (key, value)
 Set a float element to an entry specified by key.
More...
 
def SetAtInteger (key, value)
 Set a integer element to an entry specified by key.
More...
 
def SetAtMatrix (key, value)
 Set a matrix object as value element to an entry specified by key.
More...
 
def SetAtName (key, value)
 Set a string (as PDF name object) as value element to an entry specified by key.
More...
 
def SetAtRect (key, value)
 Set a rectangle object as value element to an entry specified by key.
More...
 
def 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...
 
def SetAtString (key, value)
 Set a string as value element to an entry specified by key.
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 fsdk.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

◆ GetElement()

def fsdk.PDFDictionary.GetElement (   key)

Get the value element of an entry with specified key.

Parameters
[in]keyThe 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()

def fsdk.PDFDictionary.GetKey (   position)

Get the key of an entry specified by position.

Parameters
[in]positionA POSITION that specifies the position of the entry. It should not be null or 0.
Returns
The key of the specified entry.

◆ GetValue()

def fsdk.PDFDictionary.GetValue (   position)

Get the value element of an entry specified by position.

Parameters
[in]positionA 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()

def fsdk.PDFDictionary.HasKey (   key)

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

Parameters
[in]keyThe 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()

def fsdk.PDFDictionary.MoveNext (   position)

Move to the position of first or the next entry.

Parameters
[in]positionA 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()

def fsdk.PDFDictionary.RemoveAt (   key)

Remove an entry specified by key.

Parameters
[in]keyThe key of the entry to be removed. It should not be an empty string.
Returns
None.

◆ SetAt()

def fsdk.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 fsdk.PDFDictionary.SetAtReference .

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]pdf_objectA 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()

def fsdk.PDFDictionary.SetAtBoolean (   key,
  value 
)

Set boolean element an entry specified by key.

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA boolean element which will be set to the entry.
Returns
None.

◆ SetAtDateTime()

def fsdk.PDFDictionary.SetAtDateTime (   key,
  value 
)

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

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueThe date time information which will be set to the entry.
Returns
None.

◆ SetAtFloat()

def fsdk.PDFDictionary.SetAtFloat (   key,
  value 
)

Set a float element to an entry specified by key.

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA float value which will be set to the entry.
Returns
None.

◆ SetAtInteger()

def fsdk.PDFDictionary.SetAtInteger (   key,
  value 
)

Set a integer element to an entry specified by key.

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueAn integer value which will be set to the entry.
Returns
None.

◆ SetAtMatrix()

def fsdk.PDFDictionary.SetAtMatrix (   key,
  value 
)

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

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA matrix which will be set to the entry.
Returns
None.

◆ SetAtName()

def fsdk.PDFDictionary.SetAtName (   key,
  value 
)

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

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA string which will be set as PDF name object to the entry. It should not be an empty string.
Returns
None.

◆ SetAtRect()

def fsdk.PDFDictionary.SetAtRect (   key,
  value 
)

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

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA rectangle which will be set to the entry.
Returns
None.

◆ SetAtReference()

def fsdk.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 fsdk.PDFDictionary.SetAt .

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]pdf_objectA 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]documentA 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()

def fsdk.PDFDictionary.SetAtString (   key,
  value 
)

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

Parameters
[in]keyThe key of the entry, whose value element will be set. It should not be an empty string.
[in]valueA wide string which will be set as PDF string object to the entry.
Returns
None.
Note
If to get string value, please call function fsdk.PDFObject.GetWideString .