DL Logo

PDBookmark Enumerations

PDBookmarkFontOptions

Header: PDExpT.h:1094

Description

Value options for PDBookmarkFlags.

Enum Constants

kPDBookmarkFontNormal=0x00
kPDBookmarkFontItalic=0x01
kPDBookmarkFontBold=0x02
kPDBookmarkFontBoldItalic=0x03

PDBookmark Typedefs

PDBookmark

Header: PDExpT.h:1088

Description

A bookmark on a page in a PDF file. Each bookmark has a title that appears on screen, and an action that specifies what happens when a user clicks on the bookmark. Bookmarks can either be created interactively by the user through the Acrobat viewer's user interface or programmatically generated. The typical action for a user-created bookmark is to move to another location in the current document, although any action (see PDAction) can be specified.

Syntax

typedef OPAQUE_64_BITS PDBookmark;

Returned From

Used By

PDBookmarkFlags

Header: PDExpT.h:1100

Description

For value options see PDBookmarkFontOptions.

Syntax

typedef ASEnum8 PDBookmarkFlags;

PDBookmark Functions

PDBookmarkAddChild

Header: PDProcs.h:905

Description

Adds aBookmark as the last child of parent, adjusting the tree containing parent appropriately. If parent previously had no children, it is open after the child is added.

Syntax

void PDBookmarkAddChild(PDBookmark parent, PDBookmark aBookmark);

Parameters

parent
The parent of the bookmark being added.
aBookmark
The bookmark that will become the last child of aBookmark. aBookmark must have been previously unlinked.

PDBookmarkAddNewChild

Header: PDProcs.h:773

Description

Adds a new bookmark to the tree containing aBookmark, as the new last child of aBookmark. If aBookmark previously had no children, it will be open after the child is added.

Syntax

PDBookmark PDBookmarkAddNewChild(PDBookmark aBookmark, const char *initialText);

Parameters

aBookmark
The bookmark to which a new last child is added.
initialText
The new bookmark's title.

Returns

The newly created bookmark.

PDBookmarkAddNewChildASText

Header: PDProcs.h:11664

Description

Adds a new bookmark to the tree containing aBookmark, as the new last child of aBookmark. If aBookmark previously had no children, it will be open after the child is added.

Syntax

PDBookmark PDBookmarkAddNewChildASText(PDBookmark aBookmark, const ASText initialText);

Parameters

aBookmark
The bookmark to which a new last child is added.
initialText
The text object containing the new bookmark's title.

Returns

The newly created bookmark.

PDBookmarkAddNewSibling

Header: PDProcs.h:752

Description

Adds a new bookmark to the tree containing aBookmark, as the new right sibling.

Syntax

PDBookmark PDBookmarkAddNewSibling(PDBookmark aBookmark, char *initialText);

Parameters

aBookmark
The bookmark that will be the left sibling of the new bookmark.
initialText
The new bookmark's title.

Returns

The newly created bookmark.

PDBookmarkAddNewSiblingASText

Header: PDProcs.h:11638

Description

Adds a new bookmark to the tree containing aBookmark, as the new right sibling.

Syntax

PDBookmark PDBookmarkAddNewSiblingASText(PDBookmark aBookmark, const ASText initialText);

Parameters

aBookmark
The bookmark that will be the left sibling of the new bookmark.
initialText
The text object containing the new bookmark's title.

Returns

The newly created bookmark.

PDBookmarkAddNext

Header: PDProcs.h:885

Description

Adds newNext as the new right sibling to aBookmark.

Syntax

void PDBookmarkAddNext(PDBookmark aBookmark, PDBookmark newNext);

Parameters

aBookmark
IN/OUT The bookmark that will receive a new right sibling.
newNext
IN/OUT The bookmark to become the new right sibling of aBookmark. newNext must have been previously unlinked.

PDBookmarkAddPrev

Header: PDProcs.h:867

Description

Adds newPrev as the new left sibling to aBookmark, adjusting the tree containing aBookmark appropriately.

Syntax

void PDBookmarkAddPrev(PDBookmark aBookmark, PDBookmark newPrev);

Parameters

aBookmark
The bookmark that will receive a new left sibling newPrev.
newPrev
The bookmark to become the new left sibling of aBookmark. newPrev must have been previously unlinked.

PDBookmarkAddSubtree

Header: PDProcs.h:797

Description

Adds a copy of the bookmark subtree source to aBookmark, as a new last child of aBookmark. This new item will have the text value sourceTitle, will be open, and will have no destination attribute. source must have been previously unlinked. If aBookmark previously had no children, it will be open after the subtree is added.

Syntax

void PDBookmarkAddSubtree(PDBookmark aBookmark, PDBookmark source, char *sourceTitle);

Parameters

aBookmark
IN/OUT The bookmark to which the subtree source will be added as a new last child.
source
IN/OUT The bookmark subtree to add.
sourceTitle
IN/OUT The new bookmark's title.

PDBookmarkAddSubtreeASText

Header: PDProcs.h:11693

Description

Adds a copy of the bookmark subtree source to aBookmark, as a new last child of aBookmark. This new item will have the text value sourceTitle, will be open, and will have no destination attribute. source must have been previously unlinked. If aBookmark previously had no children, it will be open after the subtree is added.

Syntax

void PDBookmarkAddSubtreeASText(PDBookmark aBookmark, PDBookmark source, const ASText sourceTitle);

Parameters

aBookmark
The bookmark to which the subtree source will be added as a new last child.
source
The bookmark subtree to add.
sourceTitle
The text object containing the new bookmark's title.

PDBookmarkDestroy

Header: PDProcs.h:812

Description

Removes a bookmark subtree from the bookmark tree containing it.

Syntax

void PDBookmarkDestroy(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The root bookmark of the subtree to remove.

PDBookmarkEqual

Header: PDProcs.h:1128

Description

Tests whether two bookmarks are equal. Two bookmarks are equal only if their Cos objects are equal (see CosObjEqual()).

Related Methods

Syntax

ASBool PDBookmarkEqual(PDBookmark aBookmark, PDBookmark bookmark2);

Parameters

aBookmark
The first bookmark to compare.
bookmark2
The second bookmark to compare.

Returns

true if the bookmarks are equal, false otherwise.

PDBookmarkFromCosObj

Header: PDProcs.h:1157

Description

Converts a Cos dictionary object to a bookmark and checks the validity of the bookmark. This method does not copy the object, but is instead the logical equivalent of a type cast.

Related Methods

Syntax

PDBookmark PDBookmarkFromCosObj(CosObj obj);

Parameters

obj
The dictionary Cos object whose bookmark is obtained.

Returns

The bookmark corresponding to the Cos object.

Exceptions

is raised if the bookmark is not valid as determined by PDBookmarkIsValid().

PDBookmarkGetAction

Header: PDProcs.h:1104

Description

Gets a bookmark's action. After you obtain the action, you can execute it with AVDocPerformAction().

Syntax

PDAction PDBookmarkGetAction(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose action is obtained.

Returns

The bookmark's action.

PDBookmarkGetByTitle

Header: PDProcs.h:838

Description

Gets the first bookmark whose title is aName.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

PDBookmark PDBookmarkGetByTitle(PDBookmark aBookmark, const char *aname, ASInt32 nameLen, ASInt32 maxdepth);

Parameters

aBookmark
IN/OUT The root of the bookmark subtree to search.
aname
IN/OUT The text value to search for. Character codes in aName are interpreted using the PDFDocEncoding.
nameLen
IN/OUT The length of aName.
maxdepth
IN/OUT The number of subtree levels to search, not counting the root level:
Value
Description
0
Only look at aBookmark, not at any of its children.
1
Check aBookmark and its children, but not any grandchildren or great grandchildren, and so on.
-1
Check the entire subtree.

Returns

The bookmark with the specified title, or a NULL Cos object if there is no such bookmark.

PDBookmarkGetByTitleASText

Header: PDProcs.h:11716

Description

Gets the first bookmark whose title is set in passed the ASText object.

Related Methods

Syntax

PDBookmark PDBookmarkGetByTitleASText(PDBookmark aBookmark, const ASText title, ASInt32 maxDepth);

Parameters

aBookmark
The root of the bookmark subtree to search.
title
The text object containing the title value to search for.
maxDepth
The number of subtree levels to search, not counting the root level.
Value
Description
0
Only look at aBookmark, not at any of its children.
1
Check aBookmark and its children, but not any grandchildren or great grandchildren, and so on.
-1
Check the entire subtree.

Returns

The bookmark with the specified title, or a NULL Cos object if there is no such bookmark.

PDBookmarkGetColor

Header: PDProcs.h:8098

Description

Retrieves the color of the specified bookmark.

An exception is thrown if the bookmark is invalid or the existing color is malformed in the PDF file.

Related Methods

Syntax

ASBool PDBookmarkGetColor(PDBookmark bm, PDColorValue pdcvOut);

Parameters

bm
The bookmark in question.
pdcvOut
(Filled by the method) The color of the bookmark in PDColorValue format.

Returns

true if the color was specified, false otherwise (the default color is returned in pdcvOut).

PDBookmarkGetCosObj

Header: PDProcs.h:1142

Description

Gets the Cos object for a bookmark. This method does not copy the object, but is instead the logical equivalent of a type cast.

Syntax

CosObj PDBookmarkGetCosObj(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose Cos object is obtained.

Returns

The dictionary Cos object for the bookmark. The contents of the dictionary can be enumerated using CosObjEnum().

PDBookmarkGetCount

Header: PDProcs.h:849

Description

Gets the number of open bookmarks in a subtree.

Syntax

ASInt32 PDBookmarkGetCount(PDBookmark aBookmark);

Parameters

aBookmark
The root bookmark of a subtree to count.

Returns

The number of open bookmarks in the subtree (not including aBookmark).

PDBookmarkGetFirstChild

Header: PDProcs.h:955

Description

Gets a bookmark's first child.

Syntax

PDBookmark PDBookmarkGetFirstChild(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose first child is obtained.

Returns

The first child of aBookmark, or a NULL Cos object if aBookmark has no children.

PDBookmarkGetFlags

Header: PDProcs.h:8124

Description

Retrieves the flags of the specified bookmark.

An exception is thrown if the bookmark is invalid or the existing style is malformed in the PDF file.

Related Methods

Syntax

ASInt32 PDBookmarkGetFlags(PDBookmark bm);

Parameters

bm
The bookmark whose flags are obtained.

Returns

The bookmark's flags. Bit 1 (the least significant bit) indicates an italic font; bit 2 indicates a bold font.

PDBookmarkGetIndent

Header: PDProcs.h:1009

Description

Returns the indentation level of a bookmark in its containing tree.

Syntax

ASInt32 PDBookmarkGetIndent(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose indentation level is obtained.

Returns

The indentation level of aBookmark in its containing tree. The root and its direct children have an indentation level of zero.

PDBookmarkGetLastChild

Header: PDProcs.h:969

Description

Gets a bookmark's last child.

Syntax

PDBookmark PDBookmarkGetLastChild(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose last child is obtained.

Returns

The last child of aBookmark, or a NULL Cos object if aBookmark has no children.

PDBookmarkGetNext

Header: PDProcs.h:983

Description

Gets a bookmark's next (right) sibling.

Syntax

PDBookmark PDBookmarkGetNext(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark whose right sibling is obtained.

Returns

The aBookmark object's next (right) sibling. It returns a NULL Cos object if aBookmark has no next sibling (that is, it is its parent's last child).

PDBookmarkGetParent

Header: PDProcs.h:940

Description

Gets a bookmark's parent bookmark.

Syntax

PDBookmark PDBookmarkGetParent(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark whose parent is obtained.

Returns

The parent bookmark of aBookmark, or a NULL Cos object if aBookmark is the root of its tree.

PDBookmarkGetPrev

Header: PDProcs.h:998

Description

Returns a bookmark's previous (left) sibling.

Syntax

PDBookmark PDBookmarkGetPrev(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark whose left sibling is obtained.

Returns

Previous (left) sibling of aBookmark, or a NULL Cos object if aBookmark has no previous sibling (it is its parent's first child).

PDBookmarkGetTitle

Header: PDProcs.h:1036

Description

Gets a bookmark's title.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

ASInt32 PDBookmarkGetTitle(PDBookmark aBookmark, char *buffer, ASInt32 bufSize);

Parameters

aBookmark
The bookmark whose title is obtained.
buffer
(Filled by the method) The buffer into which the title will be written. If buffer is non- NULL, its length is assumed to be bufSize + 1, because a NULL byte is appended to the title. The returned text remains valid only until the next PDModel method call. The text may be converted to a platform's native encoding using PDXlateToHost() or PDXlateToHostEx().
bufSize
The size of the buffer.

Returns

The number of bytes copied into buffer, not counting the trailing NULL byte. If buffer is NULL, the number of bytes in the bookmark is returned.

PDBookmarkGetTitleASText

Header: PDProcs.h:11596

Description

Gets a bookmark's title as an ASText object.

Syntax

void PDBookmarkGetTitleASText(PDBookmark aBookmark, ASText title);

Parameters

aBookmark
The bookmark whose title is obtained.
title
(Filled by the method) The text object containing the title. The client must pass a valid ASText object title. The routine does not allocate it.

PDBookmarkHasChildren

Header: PDProcs.h:1068

Description

Tests whether a bookmark has children.

Syntax

ASBool PDBookmarkHasChildren(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark to test.

Returns

true if aBookmark has any children, false otherwise.

PDBookmarkIsOpen

Header: PDProcs.h:1078

Description

Tests whether a bookmark is open. An open bookmark shows all its children.

Related Methods

Syntax

ASBool PDBookmarkIsOpen(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark to test.

Returns

true if the bookmark is open, false otherwise.

PDBookmarkIsValid

Header: PDProcs.h:927

Description

Tests whether a bookmark is valid. This is intended only to ensure that the bookmark has not been deleted, not to ensure that all necessary information is present and valid.

Related Methods

Syntax

ASBool PDBookmarkIsValid(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark whose validity is tested.

Returns

true if the bookmark is valid, false otherwise.

PDBookmarkRemoveAction

Header: PDProcs.h:7961

Description

Removes a bookmark's action.

Syntax

void PDBookmarkRemoveAction(PDBookmark aBookmark);

Parameters

aBookmark
The bookmark whose action is removed.

Exceptions

PDBookmarkSetAction

Header: PDProcs.h:1115

Description

Sets a bookmark's action.

Related Methods

Syntax

void PDBookmarkSetAction(PDBookmark aBookmark, PDAction action);

Parameters

aBookmark
IN/OUT The bookmark whose action is set.
action
IN/OUT The bookmark's action.

PDBookmarkSetColor

Header: PDProcs.h:8111

Description

Sets the color of the specified bookmark.

Related Methods

Syntax

void PDBookmarkSetColor(PDBookmark bm, PDColorValue pdcvIn);

Parameters

bm
The bookmark whose color is set.
pdcvIn
The new color. It must be in DeviceRGB.

Exceptions

If
color is NULL or not in DeviceRGB, the bookmark is invalid or the existing bookmark color is malformed.

PDBookmarkSetFlags

Header: PDProcs.h:8139

Description

Sets the flags of the specified bookmark.

An exception is thrown if the bookmark is invalid or the existing style is malformed in the PDF file.

Related Methods

Syntax

void PDBookmarkSetFlags(PDBookmark bm, ASInt32 nFlags);

Parameters

bm
The bookmark whose flags are set.
nFlags
The new bookmark flags. Bit 1 (the least significant bit) indicates an italic font; bit 2 indicates a bold font.

PDBookmarkSetOpen

Header: PDProcs.h:1091

Description

Opens or closes a bookmark. An open bookmark shows its children, while a closed bookmark does not.

Related Methods

Syntax

void PDBookmarkSetOpen(PDBookmark aBookmark, ASBool isOpen);

Parameters

aBookmark
IN/OUT The bookmark to open or close.
isOpen
IN/OUT true if the bookmark is opened, false if the bookmark is closed.

PDBookmarkSetTitle

Header: PDProcs.h:1059

Description

Sets a bookmark's title.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Related Methods

Syntax

void PDBookmarkSetTitle(PDBookmark aBookmark, const char *str, ASInt32 nBytes);

Parameters

aBookmark
The bookmark whose title is set.
str
A read-only string containing the bookmark's new title. The text must be encoded using PDFDocEncoding. Strings encoded using a platform's native encoding can be converted to PDFDocEncoding using PDXlateToPDFDocEnc() or PDXlateToPDFDocEncEx().
nBytes
The number of bytes of str to copy.

Exceptions

is raised if there is an error setting the title.

PDBookmarkSetTitleASText

Header: PDProcs.h:11614

Description

Sets a bookmark's title.

Syntax

void PDBookmarkSetTitleASText(PDBookmark aBookmark, const ASText title);

Parameters

aBookmark
The bookmark whose title is set.
title
The text object containing the bookmark's new title.

Exceptions

is raised if there is an error setting the title.
Header: PDProcs.h:914

Description

Unlinks a bookmark from the bookmark tree that contains it, and adjusts the tree appropriately.

Related Methods

Syntax

void PDBookmarkUnlink(PDBookmark aBookmark);

Parameters

aBookmark
IN/OUT The bookmark to unlink.