Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Printer DC

Printer DC

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Developer611
    wrote on last edited by
    #1

    Hi there . How can I get the printer DC ?

    DMASTER

    _ R L H 4 Replies Last reply
    0
    • D Developer611

      Hi there . How can I get the printer DC ?

      DMASTER

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      See if you can use CPrintDialog::GetPrinterDC

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      D 1 Reply Last reply
      0
      • D Developer611

        Hi there . How can I get the printer DC ?

        DMASTER

        R Offline
        R Offline
        Rajkumar R
        wrote on last edited by
        #3

        Printing tips and tricks from the trenches (MFC)[^]

        1 Reply Last reply
        0
        • _ _AnsHUMAN_

          See if you can use CPrintDialog::GetPrinterDC

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          D Offline
          D Offline
          Developer611
          wrote on last edited by
          #4

          Thanks to your reply. I don't want to use MFC, I need a solution with windows API.

          DMASTER

          R 1 Reply Last reply
          0
          • D Developer611

            Thanks to your reply. I don't want to use MFC, I need a solution with windows API.

            DMASTER

            R Offline
            R Offline
            Rajkumar R
            wrote on last edited by
            #5

            Retrieving a Printer Device Context[^] Creating a Printer Device Context[^] Using the Print Property Sheet[^] more[^]

            1 Reply Last reply
            0
            • D Developer611

              Hi there . How can I get the printer DC ?

              DMASTER

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              HDC hDC; CDC PrinterDC; hDC = CreateDC( NULL, "YOUR PRINTERNAME", NULL, NULL ); PrinterDC.Attach( hDC ); DOCINFO stDocInfo; memset( &stDocInfo, 0, sizeof( DOCINFO )); stDocInfo.cbSize = sizeof( DOCINFO ); stDocInfo.lpszDocName = _T( "TEST" ); // Document name StartDoc( hDC, &stDocInfo ); CPen DrawPen( PS_DASH, 5, RGB( 0, 0, 0 )); CBrush DrawBrush( HS_BDIAGONAL, RGB( 0, 0, 255 )); PrinterDC.SelectObject( &DrawPen ); //PrinterDC.SelectObject( &DrawBrush ) ; PrinterDC.SetBkMode( TRANSPARENT ); StartPage( hDC ); CRect Rect( 0, 0, 100, 100 ); PrinterDC.Rectangle( &Rect ); PrinterDC.MoveTo( 0, 0 ); PrinterDC.LineTo( 100, 100 ); CString csText( _T( "Orientation" )); TextOut( hDC, 50, 50, csText.operator LPCTSTR(), csText.GetLength()); EndPage( hDC ); EndDoc( hDC ); PrinterDC.Detach();

              1 Reply Last reply
              0
              • D Developer611

                Hi there . How can I get the printer DC ?

                DMASTER

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                And see these examples:here[^] and here[^].

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups