FoxitPDFSDKforWeb  v10.0.0
Foxit PDF SDK for Web
PDFDictionary Class Reference

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
keystring - 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
keystring - 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
keystring - Specifies the key of dictionary.
valuenumber|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);
}

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.