Program for Printer in C language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • murad
    New Member
    • Dec 2006
    • 1

    Program for Printer in C language

    I am studant. I want to interface printer with Parallel port.
    Kindly send me any Program so that i can take print on printer.

    Also I have no driver for said printer. then only C/C++ code will
    work.
    soon response will be highly appretiated.
    regards
  • AdrianH
    Recognized Expert Top Contributor
    • Feb 2007
    • 1251

    #2
    Originally posted by murad
    I am studant. I want to interface printer with Parallel port.
    Kindly send me any Program so that i can take print on printer.

    Also I have no driver for said printer. then only C/C++ code will
    work.
    soon response will be highly appretiated.
    regards
    For what OS?


    Adrian

    Comment

    • AdrianH
      Recognized Expert Top Contributor
      • Feb 2007
      • 1251

      #3
      Originally posted by murad
      I am studant. I want to interface printer with Parallel port.
      Kindly send me any Program so that i can take print on printer.

      Also I have no driver for said printer. then only C/C++ code will
      work.
      soon response will be highly appretiated.
      regards
      For what OS? If you use windows, open a file to "LPT1:", if you are using UNIX flavor, open a file to "/dev/....". Hmm, seems like I have forgotten the device name for the parallel port in UNIX. :) if it is a serial it is Stty0 for the first port I think, but for parallel? Not sure.

      Anyway, the point here is that you probably don't need a driver, unless you need to use the line signals. Then that gets a bit more complicated and you need to still need to know the OS to be able to interface with the correct API. But if you are just using it as a line printer, or even a PS printer, you only need to really access it via a file handle.

      Hope this helps.


      Adrian

      Comment

      Working...