Thread: how do you print in C

  1. #16
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Quote Originally Posted by oogabooga View Post
    And you could of course try anduril's approach, but you'll still have to be able to refer to your printer somehow.
    Well, if you use ConnectToPrinterDlg function (Windows), it will do it's best to connect to the printer you selected and return a handle to it. After that, I'm guessing the following functions might be helpful. Browsing MSDN and Googling for some examples and tutorials would be a good idea.
    buthttp://msdn.microsoft.com/en-us/library/windows/desktop/dd162751(v=vs.85).aspx
    AddJob function (Windows)
    StartDocPrinter function (Windows)
    StartPagePrinter function (Windows)

  2. #17
    Registered User
    Join Date
    Jan 2010
    Posts
    208
    sorry I took so long to reply my system command was

    system("print /D:usb001 REPORT.txt");

    It gives me the message

    unable to initialize device usb001
    Last edited by artistunknown; 11-08-2013 at 04:18 PM.

  3. #18
    Registered User
    Join Date
    Jan 2010
    Posts
    208
    redirection doen't work neither it just opens the REPORT.txt in notepad which isn't what I want because I have a formfeed in the report and I would like for it to recognize it
    and I'm not sure the formfeed would be recognized by the printer in dos either

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Print statement won't print
    By Sakari in forum C Programming
    Replies: 17
    Last Post: 06-20-2012, 06:41 PM
  2. Replies: 15
    Last Post: 06-13-2012, 12:34 PM
  3. Replies: 10
    Last Post: 02-19-2010, 07:50 PM
  4. Replies: 0
    Last Post: 03-28-2003, 08:20 AM
  5. print first and print last function
    By RawleyMacias in forum C Programming
    Replies: 6
    Last Post: 02-14-2002, 10:28 PM