Call this function to format a range of text in a rich edit control for the output device specified by pDC.
Pointer to a device context for page output.
Zero-based index of the first character to be formatted.
Zero-based index of the last character to be formatted.
The index of the last character that fits on the page plus one.
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.