AddBookmarkItem

<< Click to Display Table of Contents >>

Navigation:  Printing Process > IPXCPrinter Interface > Functions >

AddBookmarkItem


 

DAPI_ICON_ AddBookmarkItem

 


 

The AddBookmarkItem function is used to add new items to the bookmarks tree template. Values returned from this function can be used to call the same function again. Please note that declarations are case-sensitive:

 

Declaration

 

C#

 

int AddBookmarkItem(int nParent,

   int dwDetectFlags,

   string sDet_FontName,

   int nDet_FontStyle,

   int nDet_Size,

   int nDet_SizeDelta,

   int nDet_Textcolor,

   int dwDisplayFlags,

   int dwDisplaycolor);

 

C++

 

HRESULT AddBookmarkItem([inlong nParent,

   [inlong dwDetectFlags,

   [inBSTR sDet_FontName,

   [inlong nDet_FontStyle,

   [inlong nDet_Size,

   [inlong nDet_SizeDelta,

   [inlong nDet_Textcolor,

   [inlong dwDisplayFlags,

   [inlong dwDisplaycolor,

   [out,retvallongpID);

 

VB

 

Function AddBookmarkItem(nParent As Long,

   dwDetectFlags As Long,

   sDet_FontName As String,

   nDet_FontStyle As Long,

   nDet_Size As Long,

   nDet_SizeDelta As Long,

   nDet_Textcolor As Long,

   dwDisplayFlags As Long,

   dwDisplaycolor As LongAs Long

 

Parameters

 

nParent

Specifies the parent ID of the item to be created. This can be a value returned from a previous call to this function, or -1 to create a top level item.

 

dwDetectFlags

This parameter is used to specify patterns of text. Text in printed documents that matches the specifications will be converted into bookmark items. Please note that the value of this parameter cannot be zero - at least one parameter must be used, and multiple values can be used as desired. The following values are available:

 

 

BIT

 

 

VALUE

 

DEFINITION

0

1

 

If this bit is selected then text of the font specified in sDet_FontName is used to create bookmark items.

 

sDet_FontName cannot be set to NULL or be an empty string when this flag is used.

 

1

2

 

If this bit is selected then text of the style specified in nDet_FontStyle is used to create bookmark items.

 

 

2

4

 

If this bit is selected then text of the size specified in the nDet_Size and nDet_SizeDelta parameters is used to create bookmark items. Text of the size nDet_Size ± nDet_SizeDelta will be used.

 

 

3

 

8

 

If this bit is selected then the nDet_Textcolor parameter is also used to detect bookmark items.

 

 

sDet_FontName

Specifies the font name used to determine bookmark items.

 

nDet_FontStyle

Specifies the font style used to determine bookmark items. The following values are available and can be combined as desired:

 

0 - Normal Font

1 - Bold

2 - Italic

3 - Bold and Italic

 

nDet_Size

Specifies the font size used to determine bookmark items. Font sizes must be specified in tenths of a point.

 

nDet_SizeDelta

Specifies the font size delta used to determine bookmark items. The delta value must be specified in tenths of a point.

 

nDet_Textcolor

Specifies the text color used to determine bookmark items.

 

dwDisplayFlags

Specifies how bookmark items are displayed. The following values are available and can be combined as desired:

 

 

BIT

 

 

VALUE

 

DEFINITION

0

1

 

If this bit is selected then bookmark items will be displayed in bold.

 

1

2

 

If this bit is selected then bookmark items will be displayed in italics.

 

 

2

4

 

If this bit is selelected then bookmark items will be expanded by default. This flag is used only when Bookmarks property DisplayMode is set to the value ByItem.

 

 

dwDisplaycolor

Specifies the color of matching bookmark items as they appear in the bookmark tree. The RGB Macro defined in Windows API is used to specify the color.

 

Return Value

 

This function returns an internal ID for the bookmark item. Internal IDs can be used as a nParent parameter for later calls to the AddBookmarkItem function.

 

Example

 

The following example creates a simple bookmarks detection tree determined according to the following parameters:

 

12pt, bold Times New Roman will be used to create top-level items.

12pt Times New Roman will be used to create second-level items.

14pt, bold Arial will be used to create top-level items and will be displayed in red.

 

VB

 

Dim parent as Long

parent = PXCPrinter.AddBookmarkItem(-17, "Times New Roman", 1120500,0)

PXCPrinter.AddBookmarkItem(parent7, "Times New Roman", 01205000)

PXCPrinter.AddBookmarkItem(-17, "Arial", 1140500255)