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. Need printing help - How to print on 1/4 the part of A4 paper on dot-matrix printer

Need printing help - How to print on 1/4 the part of A4 paper on dot-matrix printer

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelptutorialworkspace
7 Posts 2 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.
  • A Offline
    A Offline
    anand_study
    wrote on last edited by
    #1

    I checked many printing articles on CodeProject and CodeGuru Need some help/guidance. From my app (Environment - VC++ 6.0, MFC, Win98/2000/XP), I need to print single as well as batch of invoices and checks on dot-matrix printer - print checks (multiple checks on single A4 page) - print multiple invoices on one A4 or other custome size paper (e.g. 4 small-invoices on one A4 size papers) Question is: For dot-matrix printer, how to achieve printing such that if one invoice is printed in top 1/4 part of A4 paper, whole paper should not come out ? (User may cut printed portion of paper and aftter sometime may continue to print next invoice on same paper). (Similarly need to print one or more check) Any sample or code snippet for such printing ? I appreciate any help/guidance. Anand_Arv

    M 1 Reply Last reply
    0
    • A anand_study

      I checked many printing articles on CodeProject and CodeGuru Need some help/guidance. From my app (Environment - VC++ 6.0, MFC, Win98/2000/XP), I need to print single as well as batch of invoices and checks on dot-matrix printer - print checks (multiple checks on single A4 page) - print multiple invoices on one A4 or other custome size paper (e.g. 4 small-invoices on one A4 size papers) Question is: For dot-matrix printer, how to achieve printing such that if one invoice is printed in top 1/4 part of A4 paper, whole paper should not come out ? (User may cut printed portion of paper and aftter sometime may continue to print next invoice on same paper). (Similarly need to print one or more check) Any sample or code snippet for such printing ? I appreciate any help/guidance. Anand_Arv

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      To use GDI to print then I imagine you'd need to change the paper size to a user-defined value using the printer driver's configuration interface. Mark

      Great job, team. Head back to base for debriefing and cocktails.

      A 1 Reply Last reply
      0
      • M Mark Salsbery

        To use GDI to print then I imagine you'd need to change the paper size to a user-defined value using the printer driver's configuration interface. Mark

        Great job, team. Head back to base for debriefing and cocktails.

        A Offline
        A Offline
        anand_study
        wrote on last edited by
        #3

        Problem is...I need to print part of paper and then paper should not be ejected. How to achieve that ? (in an App developed with VC++/MFC and running on WinXP/Win98/Win2000) Thanks a lot for helping. Anand_Arv

        M 2 Replies Last reply
        0
        • A anand_study

          Problem is...I need to print part of paper and then paper should not be ejected. How to achieve that ? (in an App developed with VC++/MFC and running on WinXP/Win98/Win2000) Thanks a lot for helping. Anand_Arv

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I understand :) The problem is that to GDI, it's the paper size setting that causes the advance to the next page when you call EndPage (or EndDoc) from your code. If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75. Mark

          "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

          A 1 Reply Last reply
          0
          • A anand_study

            Problem is...I need to print part of paper and then paper should not be ejected. How to achieve that ? (in an App developed with VC++/MFC and running on WinXP/Win98/Win2000) Thanks a lot for helping. Anand_Arv

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            An alternative method is to send escape codes directly to the printer instead of using GDI... HOWTO: Send Raw Data to a Printer by Using the Win32 API[^]

            "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

            1 Reply Last reply
            0
            • M Mark Salsbery

              I understand :) The problem is that to GDI, it's the paper size setting that causes the advance to the next page when you call EndPage (or EndDoc) from your code. If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75. Mark

              "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

              A Offline
              A Offline
              anand_study
              wrote on last edited by
              #6

              Mark Salsbery wrote:

              I understand The problem is that to GDI, it's the paper size setting that causes the advance to the next page when you call EndPage (or EndDoc) from your code. If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75.

              Thanks a lot for nice info. Just curious to know... Does this apply only to Dot Matrix Printer ? i.e. For Laser/Inkjet printer, if I set paper size to 8.5 x 2.75 and use A4 paper, will it eject A4 paper fully or it will allow to continu printing on same paper ? Anand

              M 1 Reply Last reply
              0
              • A anand_study

                Mark Salsbery wrote:

                I understand The problem is that to GDI, it's the paper size setting that causes the advance to the next page when you call EndPage (or EndDoc) from your code. If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75.

                Thanks a lot for nice info. Just curious to know... Does this apply only to Dot Matrix Printer ? i.e. For Laser/Inkjet printer, if I set paper size to 8.5 x 2.75 and use A4 paper, will it eject A4 paper fully or it will allow to continu printing on same paper ? Anand

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                From my experience, a laser printer will eject the page at the end. I'm no printing expert so I'm not sre how one can control it more precisely. I know you could accumulate enough printing jobs to fill a sheet then do a page at a time. Laser printers I've worked with didn't have a way to linefeed the paper and tear it off. Maybe there's laser printers with continuous feed paper (rolls)? I know dot matrix printers have escape codes to do it. Mark

                "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

                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