Click to See Complete Forum and Search --> : Changing paper size and etc. without using CPrintDlg


April 25th, 1999, 05:57 AM
Dear ppl,
I need help in changing the paper size and etc in my printing module without using the CPrintDlg because i am designing my own interface. But how do i set the paper size manually? I could set the orientation using the following code:
LPDEVMODE pDevMode = (LPDEVMODE) GlobalLock(pInfo->m_pPD->m_pd.hDevMode) ;
pDevMode->dmOrientation = DMORIENT_LANDSCAPE;
pDC->ResetDC(pDevMode) ;
But if i add the following statement
pDevMode->dmPaperSize = DMPAPER_ENV_B6;
it has no effect on the papersize? How could i do it?

Paul McKenzie
April 25th, 1999, 11:33 PM
Maybe the print driver doesn't recognize the setting of the paper size. How about trying another paper size constant? You're changing orientation successfully, so the paper size change should also work.

When I get these problems, I usually write a loop that goes through all of the Windows paper size constants and checks to see which ones the driver recognizes successfully (I know that I'm wasting paper, but it's for a good cause; my job! :-)).

Regards,

Paul McKenzie