Thread: Printing

  1. #1
    Unregistered
    Guest

    Unhappy Printing

    Hello i'm trying to write e c program that works on DOS, how can i write to printer (LPT1) with a similar command like "printf"?
    Is it possible?
    Thank you.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    72
    may be you should try to use file streams

    stream = fopen( "LPT1", "tw" );
    fprintf( stream, "%s","This is a PrintTest" );

    etc.

    I did not try it but it should works. :-)

  3. #3
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    it works, I've just tried it and it does, if you want to see a working code, download the file

    but, you could also create a file which contains what you wanna print, and then call the DOS command

    type myfile.txt > PRN

    and then erase the file

    It should work, but I have'nt tried it yet


    Oskilian

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    1

    Thumbs up

    Thank you for your time it works perfectly for my needs!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# Printing Problem
    By silverlight001 in forum C# Programming
    Replies: 0
    Last Post: 03-23-2009, 01:13 AM
  2. generic printing preferences dialog box
    By stanlvw in forum Windows Programming
    Replies: 8
    Last Post: 06-27-2008, 02:20 AM
  3. printing data to a file
    By coralreef in forum C Programming
    Replies: 3
    Last Post: 11-02-2006, 08:10 PM
  4. need help relating printing?
    By omarlodhi in forum Linux Programming
    Replies: 0
    Last Post: 03-03-2006, 04:46 AM
  5. Printing
    By Dual-Catfish in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-25-2002, 08:10 PM