Поделиться через


CRichEditView::SetPaperSize

Call this function to set the paper size for printing this rich edit view.

void SetPaperSize(
   CSize sizePaper 
);

Параметры

  • sizePaper
    The new paper size values for printing, measured in MM_TWIPS.

Заметки

If m_nWordWrap is WrapToTargetDevice, you should call WrapChanged after using this function to adjust printing characteristics.

Пример

BOOL CMyRichEditView::OnPreparePrinting(CPrintInfo* pInfo)
{
   // Set the printing margins (720 twips = 1/2 inch).
   SetMargins(CRect(720, 720, 720, 720));

   // Change the paper orientation to landscape mode
   // See the example for CWinApp::GetPrinterDeviceDefaults
   ((CMyWinApp*)AfxGetApp())->SetLandscapeMode();

   // Change the paper size in the CRichEditView to 
   // reflect landscape mode
   CSize csPaper = GetPaperSize();
   int temp;
   temp = csPaper.cx; csPaper.cx = csPaper.cy; csPaper.cy = temp;
   SetPaperSize(csPaper);

   return DoPreparePrinting(pInfo);
}

Требования

Header: afxrich.h

См. также

Основные понятия

CRichEditView Class

CRichEditView Members

Hierarchy Chart

CRichEditView::GetPaperSize

CRichEditView::GetMargins

CRichEditView::GetPrintWidth

CRichEditView::GetPrintRect

CRichEditView::GetPageRect

CRichEditView::PrintPage

CRichEditView::WrapChanged