LlRTFDisplay

Syntax:

INT LlRTFDisplay(HLLJOB hJob, HLLRTFOBJ hRTF, HDC hDC, _PRECT pRC, BOOL bRestart, LLPUINT pnState);

Task:

Paints the contents of the RTF object in a device context (DC). Can be used to display the RTF contents in a window or print them to the printer.

Parameter:

hJob: List & Label job handle

hRTF: RTF object handle

hDC: DC for the device. If NULL, the standard printer will be used.

pRC: Pointer to the rect with logical coordinates (mm/10, inch/100 etc.) in which the contents will be printed. May be NULL for a printer DC, in which case the whole printable area of the page will be used.

bRestart: If TRUE, the output will start at the beginning of the text. Otherwise it will be continued after the point where the previous print ended, thus enabling a multi-page print.

pnState: State value used by the next LlRTFDisplay() call

Return Value:

Error code

Example:

// Create Printer-DC

HDC   hDC = CreateDC(NULL,"\\\\prnsrv\\default",NULL,NULL);

RECT  rc = {0,0,1000,1000};

BOOL bFinished = FALSE;

INT nPage = 0;

// Init document

StartDoc(hDC,NULL);

while (!bFinished)

{

   nPage++;

   UINT     nState = 0;

   // Init page

         StartPage(hDC);

         // Prepare DC (set coordinate system)

   SetMapMode(hDC,MM_ISOTROPIC);

   SetWindowOrgEx(hDC,rc.left,rc.top,NULL);

   SetWindowExtEx(hDC,rc.right-rc.left,rc.bottom-rc.top,NULL);

   SetViewportOrgEx(hDC,0,0,NULL);

   SetViewportExtEx(hDC,GetDeviceCaps(hDC,HORZRES),

   GetDeviceCaps(hDC,VERTRES),NULL);

   // print RTF-Text

  BOOL bFinished = (LlRTFDisplay(hJob, hRTF, hDC, &rc, nPage ==
                   1, &nState) == LL_­WRN_­PRINTFINISHED);

   // done page

   EndPage(hDC);

}

      EndDoc(hDC);

See also:

LlRTFCreateObject