My class CChartEditorView is generated from CScrollView. It is necessary for me to output the charts representing SRGCompoundDisplay in a cycle. I use MFC. And, each chart should be output from new page.
Here is how I do:
void CChartEditorView:: OnPrepareDC (CDC* pDC, CPrintInfo* pInfo)
{
CScrollView:: OnPrepareDC (pDC, pInfo);
if (pDC-> IsPrinting ())
{
int PageHeigth = pDC-> GetDeviceCaps (VERTRES);
int OriginY = PageHeigth * (pInfo-> m_nCurPage-1);
pDC-> SetViewportOrg (0, - OriginY);
iPagePrinting = pInfo-> m_nCurPage-1;
}
}
...
...
void CChartEditorView:: OnDraw (CDC* pDC)
{
....
if (pDC-> IsPrinting ())
{
m_Graph. SetUseMaxArea (FALSE);
SetScrollSizes (MM_TEXT, CSize (0, 0));
}
....
}

Result:
see attachment

What here it is incorrect?