LL_CMND_PAGE

Task:

Allows the programmer to place additional output on the page. This is useful for printing labels, for example, as in this way you can "paint" additional information onto a page (page number, printout time, "demo" text, individual watermarks etc...)

Activation:

LlSetOption(hJob, LL_OPTION_CALLBACKMASK, <other flags> | LL_CB_PAGE);

Parameters:

lParam points to an scLlPage structure:

_nSize: Size of structure, sizeof(scLlPage)

_bDesignerPreview: TRUE if the call takes place from the Designer preview FALSE if the call takes place during the WYSIWYG-preview or print.

_bPreDraw: TRUE for a call, before List & Label draws the page.
FALSE for a call after List & Label has finished the page.

_bDesignerPreview: TRUE if the call takes place from the Designer preview FALSE if the call takes place during the WYSIWYG-preview or print.

_hPaintDC: Device Context for the print

_hRefDC: Device Context for references

Return Value:

0

Hints:

In this callback no List & Label function may be called which will produce output as a result (LlPrint(), etc.)! Functions like LlPrintGetCurrentPage(), LlPrintGetOption() or LlPrintEnableObject() are allowed.

See: Hints on the use of GDI-objects.

This function is called twice per page, once with _bPreDraw = TRUE, then with _bPreDraw = FALSE.

The page size can be determined by the function GetWindowExt(). Don't forget: use the hRefDC!

If you change the window origin of the hRefDC for _bPreDraw = TRUE with SetWindowOrg(), this affects the whole page. In this way you can define a different margin for even/odd pages. This relocation only affects the WYSIWYG viewer and printout, not the Designer preview.

Example:

case LL_CMND_PAGE:
   pSCP = (PSCLLPAGE)pSC->_lParam;
   if (pSCP->_bPreDraw && (LlPrintGetCurrentPage(hJob) % 2) == 1)
      SetWindowOrg(pSCP->_hPaintDC, -100, 0);
   break;