Knowledge Base Nr: 00309 pagepreview.cpp - http://www.swe-kaiser.de
Downloads:
MFC: querformate richtig anzeigen in druckansicht/seitenansicht
void CBaseView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
if (pInfo)
{
DEVMODE* pDM = pInfo->m_pPD->GetDevMode();
switch (m_ePageFormat)
{
case PF_DINA4:
pDM->dmPaperSize = DMPAPER_A4;
pDM->dmOrientation = DMORIENT_PORTRAIT;
break;
case PF_DINA3:
pDM->dmPaperSize = DMPAPER_A3;
pDM->dmOrientation = DMORIENT_PORTRAIT;
break;
case PF_DINA4Q:
pDM->dmPaperSize = DMPAPER_A4;
pDM->dmOrientation = DMORIENT_LANDSCAPE;
break;
case PF_DINA3Q:
pDM->dmPaperSize = DMPAPER_A3;
pDM->dmOrientation = DMORIENT_LANDSCAPE;
break;
default:
ASSERT(FALSE);
}
pDC->ResetDC(pDM);
}
}