| FoxitPDFSDKforWeb v11.0.4 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
PDFDictionary Class Reference
PDF

## Public Member Functions
| getAt (key)
| Get the value of the specified key in the pdf dictionary. More...
| hasKey (key)
| Check if the specified key is in the dictionary. More...
| setAt (key, value)
| Set key and value to the pdf dictionary. More...

## Detailed Description

PDF Dictionary object

## Member Function Documentation

## ◆ getAt()

PDFDictionary::getAt | ( |  | key | ) |
| inline

Get the value of the specified key in the pdf dictionary.

Since
  7.6.0

Parameters

  key | string - Specifies the key of dictionary.

Returns
  Promise<number|boolean|string> - If the specified key does not exist in the dictionary or the value type is unaccepted, an error will be raised.

Example:
  function example (pdfDictionary) {
  try {
  let value = await pdfDictionary.getAt('CustKey');
  } catch(e) {
  console.warn(e);
  }
  }

## ◆ hasKey()

PDFDictionary::hasKey | ( |  | key | ) |
| inline

Check if the specified key is in the dictionary.

Since
  7.6.0

Parameters

  key | string - Specifies the key of dictionary.

Returns
  Promise<boolean> - True if the key exists, otherwise false.

Example:
  function example (pdfDictionary) {
  return await pdfDictionary.hasKey('Type');
  }

## ◆ setAt()

PDFDictionary::setAt | ( |  | key,
|  |  | value
| ) |  |
| inline

Set key and value to the pdf dictionary.

Since
  7.6.0

Parameters

  key | string - Specifies the key of dictionary.
  value | number|boolean|string - Specifies the value associated with the key.

Returns
  Promise<boolean> - True if there set successfully, otherwise false.

Example:
  async function example (pdfDictionary) {
  await pdfDictionary.setAt('CustString', 'Hello');
  await pdfDictionary.setAt('CustNubmer', 100);
  await pdfDictionary.setAt('CustBoolean', true);
  }

@2025 Foxit Software Incorporated. All rights reserved.