共用方式為


CRichEditView::SetPaperSize

呼叫此函式將列印之豐富的編輯檢視的紙張大小。

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