Foxit PDF SDK

Public Member Functions | List of all members
FoxitPDFSDKPython2.Metadata Class Reference
Inheritance diagram for FoxitPDFSDKPython2.Metadata:

## Public Member Functions
def | Metadata (other)
| Constructor, with another metadata object. More...
def | GetCreationDateTime ()
| Get creation date time. More...
def | GetCustomerKeys ()
| Get customer keys from metadata. More...
def | GetModifiedDateTime ()
| Get modified date time. More...
def | GetValues (key)
| Get metadata value(s). More...
def | HasKey (key)
| Check whether the related PDF document has a specified metadata key or not. More...
def | IsEmpty ()
| Check whether current object is empty or not. More...
def | RemoveCustomerKey (key)
| Remove a specified customer key (along with related value). More...
def | SetCreationDateTime (date_time)
| Set creation date time. More...
def | SetModifiedDateTime (date_time)
| Set modified date time. More...
def | SetValues (key, value_array)
| Set metadata value(s). More...

## Detailed Description

In PDF document, metadata information is stored in document's Info dictionary or in metadata stream (represented in Extensible Markup Language, known as XML). When a key exists in both Info dictionary and metadata stream, the latest modified one will be used.
This class is constructed from PDF document object and is used to get or set metadata information from both document's Info dictionary and metadata stream.

## Constructor & Destructor Documentation

## ◆ Metadata()

def FoxitPDFSDKPython2.Metadata.Metadata | ( |  | other | ) |

Constructor, with another metadata object.

Parameters

  [in] | other | Another metadata object.

## Member Function Documentation

## ◆ GetCreationDateTime()

def FoxitPDFSDKPython2.Metadata.GetCreationDateTime | ( |  | ) |

Get creation date time.

Returns
  Creation date time. If no creation date time can be found, a date and time object with all values 0 will be returned.

## ◆ GetCustomerKeys()

def FoxitPDFSDKPython2.Metadata.GetCustomerKeys | ( |  | ) |

Get customer keys from metadata.

In Info dictionary and metadata stream, they have some standard keys which have same feature but different name. For this case, Foxit PDF SDK will use the standard key names in Info dictionary. Besides these standard keys, other keys will be treated as customer keys.

Returns
  An string array of customer keys.

## ◆ GetModifiedDateTime()

def FoxitPDFSDKPython2.Metadata.GetModifiedDateTime | ( |  | ) |

Get modified date time.

Returns
  Modified date time. If no modified date time can be found, a date and time object with all values 0 will be returned.

## ◆ GetValues()

def FoxitPDFSDKPython2.Metadata.GetValues | ( |  | key | ) |

Get metadata value(s).

For a metadata key, it may contain single or multiple values.

Parameters

  [in] | key | Metadata key string. It should not be an empty string. Currently it can be one of the following keys: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "Trapped", "CreationDate", "ModDate", "pdfaid", "InstanceID", "DocumentID". It can also be some other custom information keys if they're supported by the PDF file. For "CreationDate" and "ModDate", user is recommended to use functions FoxitPDFSDKPython2.Metadata.GetCreationDateTime and FoxitPDFSDKPython2.Metadata.GetModifiedDateTime to get the date information.

Returns
  An string array of metadata value(s).

## ◆ HasKey()

def FoxitPDFSDKPython2.Metadata.HasKey | ( |  | key | ) |

Check whether the related PDF document has a specified metadata key or not.

Parameters

  [in] | key | The metadata key to be checked.

Returns
  true means the related PDF document has the specified metadata key, while false means the related PDF document does not have the specified metadata key.

## ◆ IsEmpty()

def FoxitPDFSDKPython2.Metadata.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ RemoveCustomerKey()

def FoxitPDFSDKPython2.Metadata.RemoveCustomerKey | ( |  | key | ) |

Remove a specified customer key (along with related value).

Parameters

  [in] | key | A customer key string. It should not be an empty string. This should be one of the keys retrieved from function FoxitPDFSDKPython2.Metadata.GetCustomerKeys .

Returns
  None.

## ◆ SetCreationDateTime()

def FoxitPDFSDKPython2.Metadata.SetCreationDateTime | ( |  | date_time | ) |

Set creation date time.

Parameters

  [in] | date_time | New creation date time. Please refer to comment of class FoxitPDFSDKPython2.DateTime to check the valid range for each member.

Returns
  None.

## ◆ SetModifiedDateTime()

def FoxitPDFSDKPython2.Metadata.SetModifiedDateTime | ( |  | date_time | ) |

Set modified date time.

Parameters

  [in] | date_time | New modified date time. Please refer to comment of class FoxitPDFSDKPython2.DateTime to check the valid range for each member.

Returns
  None.

## ◆ SetValues()

def FoxitPDFSDKPython2.Metadata.SetValues | ( |  | key,
|  |  | value_array
| ) |  |

Set metadata value(s).

This function is used to set single or multiple values to a specified metadata key:

- For metadata keys "Author" and "Keywords", they can contain single or multiple values.
- For metadata key "pdfaid" which means the PDFA file version, the length of its value string is always 2, such as "2a", "1a", etc. So, only the first two characters of the first element in parameter valueArray will be used.
- For rest pre-defined keys, they do not support multiple values. So all the elements in parameter value_array will be put into one string and connected by ";". Then this string will be treated as a single value.

Parameters

  [in] | key | Metadata key string. It should not be an empty string. Currently it can be one of the following keys: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "Trapped", "CreationDate", "ModDate", "pdfaid", "InstanceID", "DocumentID". It can also be some other custom information keys if they're supported by the PDF file. For "CreationDate" and "ModDate", user is recommended to use FoxitPDFSDKPython2.Metadata.SetCreationDateTime and FoxitPDFSDKPython2.Metadata.SetModifiedDateTime to set the date information.
  [in] | value_array | An string array of metadata value(s).

Returns
  None.