CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Changing paper size and etc. without using CPrintDlg

    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?


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Changing paper size and etc. without using CPrintDlg

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured