#include “BlackIceDEVMODE.h”
DWORD SetFormattedBookmark (HDC hDC, DWORD dwParent, LPCTSTR szTitle, BYTE bRed, BYTE bGreen, BYTE bBlue, BOOL bBold, BOOL bItalic);
Description
Adds a formatted bookmark that points to the last printed line in the document. Text formatting for bookmarks may not be available in all PDF viewers. Can only be used with the Compact PDF, PDF, and PDF/A output file formats. Cannot be used with the PDF Image or other output file formats.
Parameters
HDC hDC |
- Handle to the device context used for printing. Returned by the CreateDC Windows API function or the Graphics.GetHdc() .NET method. |
DWORD dwParent |
- Identifier of the parent bookmark returned by a previous call to SetBookmark, or 0 for top-level bookmarks. |
LPCTSTR szTitle |
- The title of the bookmark |
BYTE bRed, bGreen, bBlue |
- The color of the bookmark. The values must be between 0 and 255 |
BOOL bBold |
- Set it to TRUE for bold text. |
BOOL bItalic |
- Set it to TRUE for italic text. |
Return value
The function returns the identifier of the created bookmark, or 0 on failure.
Programming Notes
None
Code Example
if (StartPage(hDC) > 0)
{
…
// Print a line
TextOut(hDC, 100, 100, _T("Black Ice test page."), (int)strlen("Black Ice test page."));
// Call SetBookmark to create a bookmark that points to the first line. Uses bold green text.
DWORD dwBookmark1 = SetFormattedBookmark(hDC, 0, _T("Bookmark 1"), 0, 255, 0, TRUE, FALSE);
// Print another line
TextOut(hDC, 100, 200, _T("Another line of the test page."), (int)strlen("Another line of the test page."));
// Call SetBookmark to create a bookmark that points to the second line which is also the children of the first bookmark.
// Uses red italic text.
SetFormattedBookmark(hDC, dwBookmark1, _T("Bookmark 2"), 255, 0, 0, FALSE, TRUE);
…
// Ending the page
EndPage(hDC);
}