Class: RoleMap

Core.PDFNet. RoleMap


new RoleMap()

RoleMap is a dictionary that maps the names of structure types used in the document to their approximate equivalents in the set of standard structure types.

Methods


<static> create(dict)

Initialize a RoleMap using an existing low-level Cos/SDF role map dictionary.
Parameters:
Name Type Description
dict Core.PDFNet.Obj a low-level (SDF/Cos) RoleMap dictionary. Note: This constructor does not copy any data, but is instead the logical equivalent of a type cast.
Returns:
A promise that resolves to an object of type: "PDFNet.RoleMap"
Type
Promise.<Core.PDFNet.RoleMap>

copy()

Copy Constructor
Returns:
A promise that resolves to an object of type: "PDFNet.RoleMap"
Type
Promise.<Core.PDFNet.RoleMap>

getDirectMap(type)

Parameters:
Name Type Description
type string element type
Returns:
A promise that resolves to the direct mapping of given StructElement type, or NULL if such mapping is not defined.
Type
Promise.<string>

getSDFObj()

Returns the RoleMap dictionary.
Returns:
A promise that resolves to the object to the underlying SDF/Cos dictionary.
Type
Promise.<Core.PDFNet.Obj>

isValid()

Returns:
A promise that resolves to true if this is a valid (non-null) RoleMap, false otherwise. If the function returns false the underlying SDF/Cos object is null or is not valid and the RoleMap should be treated as NULL object.
Type
Promise.<boolean>