printing through c++. want to use printer to print through c++.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coder933
    New Member
    • Jul 2013
    • 1

    printing through c++. want to use printer to print through c++.

    i want to print some text through printer in c++. please help me out.. please..
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Your OS should have system calls to ship data to the printer. That may mean you need to install the SDK for your OS.

    Windows uses calls like TextOut and DrawText. But you need to read up on these before attempting.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      Would it be easier to write your program so that it sends the desired output to stdout (the screen); and then redirect that output to the printer on the command line that invokes your program?

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        That's not exactly printing from the program plus the program loses it's interface. However, "print text through the printer" is pretty vague so a redirect may be good enough.

        Comment

        Working...