DL Logo

PDSTreeRoot Typedefs

PDSTreeRoot

Header: PDSExpT.h:93

Description

The root of the structure tree, which is a central repository for information related to a PDF document's logical structure. There is at most one PDSTreeRoot in each document.

Related Methods

Syntax

typedef CosObj PDSTreeRoot;

Used By

PDSTreeRoot Functions

PDDocCreateStructTreeRoot

Header: PDSWriteProcs.h:66

Description

Creates a new StructTreeRoot element.

If PDDocCreateStructTreeRoot() is called on a PDDoc that already has a structure tree root, it returns without modifying the document.

It raises an exception if pdDoc already has a StructTreeRoot.

Syntax

void PDDocCreateStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot);

Parameters

pdDoc
IN/OUT The PDDoc for which the StructTreeRoot element is created.
treeRoot
IN/OUT (Filled by the method) The newly-created StructTreeRoot element.

PDDocGetStructTreeRoot

Header: PDSReadProcs.h:59

Description

Gets the structure tree root for a document.

Syntax

ASBool PDDocGetStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot);

Parameters

pdDoc
The PDDoc whose root is obtained.
treeRoot
(Filled by the method) The structure tree root.

Returns

true if structure tree root found, false otherwise.

PDDocRemoveStructTreeRoot

Header: PDSWriteProcs.h:77

Description

Removes, but does not destroy, the specified StructTreeRoot element from the specified PDDoc.

Syntax

void PDDocRemoveStructTreeRoot(IN PDDoc pdDoc);

Parameters

pdDoc
IN/OUT The PDDoc for which the StructTreeRoot element is removed.

PDSTreeRootCreateClassMap

Header: PDSWriteProcs.h:171

Description

Creates a PDSClassMap in the specified tree root.

Any previously existing PDSClassMap is unlinked.

This may raise various exceptions.

Syntax

void PDSTreeRootCreateClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap);

Parameters

treeRoot
The structure tree root in which to create a PDSClassMap.
classMap
(Filled by the method) The newly created PDSClassMap.

PDSTreeRootCreateRoleMap

Header: PDSWriteProcs.h:140

Description

Creates and sets the PDSRoleMap of the specified StructTreeRoot element. Any previously existing PDSRoleMap is unlinked.

This may raise various exceptions.

Syntax

void PDSTreeRootCreateRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap);

Parameters

treeRoot
The structure tree root in which to create a PDSRoleMap.
roleMap
(Filled by the method) The newly created PDSRoleMap.

PDSTreeRootGetClassMap

Header: PDSReadProcs.h:120

Description

Gets the PDSClassMap object for the specified structure tree root.

This may throw various exceptions.

Related Methods

Syntax

ASBool PDSTreeRootGetClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap);

Parameters

treeRoot
The structure tree root whose PDSClassMap is obtained.
classMap
(Filled by the method) A pointer to a location in which to return the class map, if one exists. Set it to CosNull if there is no class map. If a NULL pointer is passed, no retrieval will take place.

Returns

true if there is a class map, false otherwise.

PDSTreeRootGetElementFromID

Header: PDSReadProcs.h:140

Description

Gets the element associated with the given ID, if any.

Related Methods

Syntax

ASBool PDSTreeRootGetElementFromID(IN PDSTreeRoot treeRoot, IN const char *id, IN ASInt32 numChars, OUT PDSElement *element);

Parameters

treeRoot
The structure tree root in which to search for id.
id
A pointer to a buffer containing the ID to search for.
numChars
The number of characters in id.
element
(Filled by the method) The element corresponding to id. It is undefined if no element has the specified id.

Returns

true if an element for id is found, or false with element undefined if the tree root contains no IDTree value.

Exceptions

is raised if id is NULL or numChars is zero or less.
is raised if the IDTree value in treeRoot is not a dictionary.

PDSTreeRootGetKid

Header: PDSReadProcs.h:86

Description

Gets the kid at an array index in the specified structure tree root.

Related Methods

Syntax

void PDSTreeRootGetKid(IN PDSTreeRoot treeRoot, IN ASInt32 index, OUT PDSElement *kid);

Parameters

treeRoot
The structure tree root whose kid is obtained.
index
The index of the kid to obtain.
kid
(Filled by the method) A pointer to the kid at index.

Exceptions

is raised if an error is found in the PDF file.

PDSTreeRootGetNumKids

Header: PDSReadProcs.h:71

Description

Gets the number of kids of the structure tree root.

This may throw various exceptions.

Related Methods

Syntax

ASInt32 PDSTreeRootGetNumKids(IN PDSTreeRoot treeRoot);

Parameters

treeRoot
IN/OUT The structure tree root whose number of kids is obtained.

Returns

The number of kids of the structure tree root.

PDSTreeRootGetRoleMap

Header: PDSReadProcs.h:103

Description

Gets the PDSRoleMap object for the specified structure tree root.

This may throw various exceptions.

Related Methods

Syntax

ASBool PDSTreeRootGetRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap);

Parameters

treeRoot
The structure tree root whose PDSRoleMap is obtained.
roleMap
(Filled by the method) A pointer to a location in which to return the role map, if one exists. Set it to CosNull if there is no role map. If a NULL pointer is passed, no retrieval will take place.

Returns

true if there is a role map, false otherwise.

PDSTreeRootInsertKid

Header: PDSWriteProcs.h:95

Description

Inserts the specified kid element after the given position as a kid of the specified structure tree root.

This may raise various exceptions.

Syntax

void PDSTreeRootInsertKid(IN PDSTreeRoot treeRoot, IN PDSElement kid, IN ASInt32 insertAfter);

Parameters

treeRoot
IN/OUT The structure tree root in which a kid is inserted.
kid
IN/OUT The kid to insert.
insertAfter
IN/OUT The position after which the kid is inserted. If element currently has no kids, insertAfter is ignored.

PDSTreeRootRemoveClassMap

Header: PDSWriteProcs.h:184

Description

Removes the PDSClassMap of the specified structure tree root element. It does nothing if one does not exist.

This may raise various exceptions.

Related Methods

Syntax

void PDSTreeRootRemoveClassMap(IN PDSTreeRoot treeRoot);

Parameters

treeRoot
The structure tree root whose PDSClassMap is removed.

PDSTreeRootRemoveKid

Header: PDSWriteProcs.h:110

Description

Removes the specified kid element from the specified structure tree root.

This may raise various exceptions.

Syntax

void PDSTreeRootRemoveKid(IN PDSTreeRoot treeRoot, IN PDSElement kid);

Parameters

treeRoot
IN/OUT The structure tree root whose kid is removed.
kid
IN/OUT The kid to remove.

PDSTreeRootRemoveRoleMap

Header: PDSWriteProcs.h:154

Description

Removes the PDSRoleMap of the specified structure tree root element. It does nothing if one does not exist.

This may raise various exceptions.

Syntax

void PDSTreeRootRemoveRoleMap(IN PDSTreeRoot treeRoot);

Parameters

treeRoot
The structure tree root whose PDSRoleMap is removed.

PDSTreeRootReplaceKid

Header: PDSWriteProcs.h:124

Description

Replaces structural element oldKid with element newKid as a kid of treeRoot.

This may raise various exceptions.

Syntax

void PDSTreeRootReplaceKid(IN PDSTreeRoot treeRoot, IN PDSElement oldKid, IN PDSElement newKid);

Parameters

treeRoot
IN/OUT The structure tree root whose kid is replaced.
oldKid
IN/OUT The kid to replace.
newKid
IN/OUT The kid that is replacing oldKid.

PDSTreeRootReplaceStreamRef

Header: PDSWriteProcs.h:846

Description

Updates the stream entries (Stm) in marked content reference dictionaries to reference a new Cos stream object. It replaces references to the old stream with refererences to the new stream.

This may raise various exceptions.

Syntax

void PDSTreeRootReplaceStreamRef(PDSTreeRoot treeRoot, CosObj oldStream, CosObj newStream);

Parameters

treeRoot
The structure tree root in which stream references are updated.
oldStream
The stream reference to replace.
newStream
The stream reference that is replacing oldStream.