Compartir a través de


CRichEditView::PrintPage

Call this function to format a range of text in a rich edit control for the output device specified by pDC.

long PrintPage(
   CDC* pDC,
   long nIndexStart,
   long nIndexStop 
);

Parameters

  • pDC
    Pointer to a device context for page output.

  • nIndexStart
    Zero-based index of the first character to be formatted.

  • nIndexStop
    Zero-based index of the last character to be formatted.

Return Value

The index of the last character that fits on the page plus one.

Remarks

The layout of each page is controlled by GetPageRect and GetPrintRect. Typically, this call is followed by a call to CRichEditCtrl::DisplayBand which generates the output.

Note that margins are relative to the physical page, not the logical page. Thus, margins of zero will often clip the text since many printers have unprintable areas on the page. To avoid clipping your text, you should call SetMargins and set reasonable margins before printing.

Requirements

Header: afxrich.h

See Also

Reference

CRichEditView Class

Hierarchy Chart

CRichEditView::PrintInsideRect

CRichEditView::GetPageRect

CRichEditView::GetPrintRect

CRichEditView::SetMargins

Other Resources

CRichEditView Members