views:

48

answers:

1

I want to create a software which windows will detect it as a installed printer driver and list that software under "Devices and Printers"

Just like the ImagePrinter sowftware, you can access it through following link. http://sourceforge.net/projects/imageprinter/

when this Image Printer is installed on a computer, windows lists it under Printers and Devices so we can right click and share it in our network. LAN users can add this as a remote printer and send print jobs to it, which it will in turn convert those print jobs to image format (jpg etc.) and save in a specified directory.

What I need is to get those print jobs from other PCs on LAN like ImagePrinter and send them to real printers shared in the LAN as sending from this own machine. (like the computer running my software sending those print jobs) so they could be printed.

to do this i need to get two things.. 1- creating the software in a way windows will detect it as a printer (so it could be shared easily and receive print jobs)

2- send print jobs to installed remote printers added to the machine running my software just like machine's own print jobs..

I want to do them in c# (because my rest of the application code is in C#, anyway if it can be combined together then the programming language is not a matter.)

Please give me instructions, or even some topics to read on.. coz I don't have any idea how to build it. Only little confident because ImagePrinter is a similar software.. so the task is possible.

Thanks in advance.

+1  A: 

This can be done combining four ingredients in the right way:

  • a print queue setup with a PostScript printer driver, shared on the LAN;
  • Ghostscript (scroll down to get gs871w{32,64}.exe) to convert PostScript to image;
  • Redmon (download redmon17.zip) to serve as the 'printer port monitor';
  • a DOS batch file to do exactly what you want;

The printqueue will be using the 'Red-irector Port Mon-itor' to channel the incoming PostScript jobs to a program/application/batchscript of your choice.

What's left to do is your job: write a simple program/application/batchscript which does three things:

  1. take the incoming PostScript as its input,
  2. call a Ghostscript commandline to convert input to the %imageformat% of your choice,
  3. and finally send the %imageformat% as jobs to a printer of your choice.

Here is a document that describes some of the basic need-to-know things regarding RedMon:


Here are a few additional hints:

If you are a newbie to Ghostscript, you'll probably have the biggest problem with constructing a commandline that would do what you neeed. Here are some examples.

The first one would convert data arriving from standard input (stdin, - at the end of the command) to single-page, black+white TIFF G4, with a resolution of 600dpi, where each page is a separate file, named page_001.tif, page_002.tif, etc.:

gswin32c ^
   -dBATCH ^
   -dNOPAUSE ^
   -dSAFER ^
   -sDEVICE=tiffg4 ^
   -r600x600 ^
   -sOutputFile=c:/path/to/output/page_%03d.tif ^
   -                           ### <-- note this!

Here is a Ghostscript commandline which would generate the same output, but this time as one single multi-page TIFF G4:

gswin32c ^
   -dBATCH ^
   -dNOPAUSE ^
   -dSAFER ^
   -sDEVICE=tiffg4 ^
   -r600x600 ^
   -sOutputFile=c:/path/to/output/multi_page_g4.tif ^
   -                           ### <-- note this!

You don't want black+white G4 TIFF, but colored TIFF, 32-bit CMYK? OK, use a different output device for Ghostscript:

gswin32c ^
   -dBATCH ^
   -dNOPAUSE ^
   -dSAFER ^
   -sDEVICE=tiff32nc^
   -r600x600 ^
   -sOutputFile=c:/path/to/output/multi_page_color.tif ^
   -                           ### <-- note this!

You want JPEG? Sorry, there is no such thing as multi-page JPEG. But single-page no problem:

set outputname=some-uniq-name && ^
gswin32c ^
   -dBATCH ^
   -dNOPAUSE ^
   -dSAFER ^
   -sDEVICE=jpeg ^
   -dJPEGQ=95 ^
   -r600x600 ^
   -sOutputFile=c:/path/to/output/%outputname%-page_%03d.jpeg ^
   -                           ### <-- note this!
pipitas
Thank you very much pipitas this is whole lot of information to me. Your answer gave a very good detailed solution. Right now I'm following your details and reading more on the ghostscript and Redmon. I have few problems, they might sound inappropriate because I don't know about the print job handling processes.Without converting to an image format using ghostscript is there anyway to directly accept and forward the print job as its to another computer with a real printer attached?Thanks again!
Zerone
Yes, that is possible. -- This question is a duplicate of "Print Job Accepting and Routing Software" [http://stackoverflow.com/questions/3311565/print-job-accepting-and-routing-software], btw. (and I didn't really notice before).
pipitas
@Zerone: see my second answer to your duplicated question "Print Job Accepting and routing Software" (at http://stackoverflow.com/questions/3311565/print-job-accepting-and-routing-software/3421860#3421860 )
pipitas