Sdílet prostřednictvím


CRichEditView::SetPaperSize

 

Volání této funkce můžete nastavit velikost papíru pro tisk tohoto zobrazení RTF.

Syntaxe

      void SetPaperSize(
   CSize sizePaper 
);

Parametry

  • sizePaper
    Nové hodnoty velikosti papíru pro tisk, měřená v MM_TWIPS .

Poznámky

Pokud m_nWordWrap je WrapToTargetDevice , by měl zavolat WrapChanged po použití této funkce upravit parametry tisku.

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);
}

Požadavky

Záhlaví: afxrich.h

Viz také

Třída CRichEditView
Graf hierarchie
CRichEditView::GetPaperSize
CRichEditView::GetMargins
CRichEditView::GetPrintWidth
CRichEditView::GetPrintRect
CRichEditView::GetPageRect
CRichEditView::PrintPage
CRichEditView::WrapChanged