#include “BlackIceDEVMODE.h”
DWORD SetBookmark (HDC hDC, DWORD dwParent, LPCTSTR szTitle);
Description
Adds a bookmark that points to the last printed line in the document. 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 |
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
DWORD dwBookmark1 = SetBookmark(hDC, 0, _T("Bookmark 1"));
// 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 that is also the children of the first bookmark
SetBookmark(hDC, dwBookmark1, _T("Bookmark 2"));
…
// Ending the page
EndPage(hDC);
}