Results 1 to 3 of 3

Thread: Help on printing from console app

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Help on printing from console app

    I am working on a console application which will use printing to print some data from a byte array file. I don't need any fancy settings that Windows form printing enables me to do, I just need to send the byte array to a hp laserjet printer, and it will take it from there. Now, a few questions crossed my mind... how do I do this? Can I do it by sending PCL commands to some port using UDP/TCP, or can I use some of C# baseclasses and perhaps just spool it to windows print manager and it can do a raw printing (I need the file to be send and printed just as it is, that means no PostScript conversion or anything)??? What means are there? I have tried making an ftp client in C# and print from there, but that didn't work very well... I need a simpler method. Any and all help would be greatly appreciated.


    best regards
    Henrik

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Check out the code at this link.
    http://msdn.microsoft.com/library/de...PrintTopic.asp
    It prints a stream, maybe you can use that.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    Thanks for the link, but this article show the implementation of line printing. I need to send a binary stream for printing to the printer. The events are as following:

    *Read a file by using a filestream + binaryreader and store the file content to a byte array


    * Send the file to the windows print manager which will UNTOUCHED print it to the printer. No conversion of any kind (PCL, LPD, PostScript)


    that's it. The hard part is to make it print right. Note that this system won't have ANY kind of user interaction... It will run 7/24 and scan a directory for files... and print if there are any.


    best regards
    Henrik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width