[]
        
(Showing Draft Content)

RoleMap

Class: RoleMap

Represents the value of the RoleMap entry of the structure tree: a dictionary that maps the names of structure types used in a document to their approximate equivalents in the set of standard structure types. See the PDF specification for details.

Both keys and values are PDF names (plain JS strings).

Obtain it from StructTreeRoot#roleMap.

Extends

Accessors

count

Get Signature

get count(): number;

Gets the number of entries in the map.

Returns

number


id

Get Signature

get id(): number;

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


om

Get Signature

get om(): ObjectManager;

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om

Methods

clear()

clear(): void;

Removes all entries from the map.

Returns

void


contains()

contains(key): boolean;

Determines whether the map contains the specified key.

Parameters

key

string

The structure type name to check.

Returns

boolean

true if the key is present, false otherwise.


entries()

entries(): [string, string][];

Gets the array of key/value pairs in the map.

Returns

[string, string][]


free()

free(): void;

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


get()

get(key): string;

Gets the standard structure type name mapped to the specified key.

Parameters

key

string

The structure type name used in the document.

Returns

string

The mapped standard structure type name, or undefined if the key is not present.


keys()

keys(): string[];

Gets the array of keys (the structure type names used in the document).

Returns

string[]


rebind()

rebind(omTo): void;

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind


remove()

remove(key): boolean;

Removes the entry with the specified key.

Parameters

key

string

The structure type name to remove.

Returns

boolean

true if the entry was actually removed, false otherwise.


set()

set(key, value): void;

Maps the specified structure type name to a standard structure type name.

Parameters

key

string

The structure type name used in the document.

value

string

The equivalent standard structure type name.

Returns

void