<< Click to Display Table of Contents >> Navigation: Drivers API > IPXCPrinter Interface > Functions > 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 and parameters are case-sensitive:
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([in] long nParent,
[in] long dwDetectFlags,
[in] BSTR sDet_FontName,
[in] long nDet_FontStyle,
[in] long nDet_Size,
[in] long nDet_SizeDelta,
[in] long nDet_Textcolor,
[in] long dwDisplayFlags,
[in] long dwDisplaycolor,
[out,retval] long* pID);
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 Long) As Long
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.
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.
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.
Dim parent as Long
parent = PXCPrinter.AddBookmarkItem(-1, 7, "Times New Roman", 1, 120, 5, 0, 0,0)
PXCPrinter.AddBookmarkItem(parent, 7, "Times New Roman", 0, 120, 5, 0, 0, 0)
PXCPrinter.AddBookmarkItem(-1, 7, "Arial", 1, 140, 5, 0, 0, 255)