CRichEditView::SetPaperSize

调用此函数设置打印的页面大小此rich edit视图。

void SetPaperSize(
   CSize sizePaper 
);

参数

  • sizePaper
    打印的新页面大小值,测量在 MM_TWIPS

备注

如果 m_nWordWrapWrapToTargetDevice,应该在使用此功能后调整打印特性称作 WrapChanged

示例

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选件类

层次结构图

CRichEditView::GetPaperSize

CRichEditView::GetMargins

CRichEditView::GetPrintWidth

CRichEditView::GetPrintRect

CRichEditView::GetPageRect

CRichEditView::PrintPage

CRichEditView::WrapChanged