Software to receive printjobs and forward them to printers in a LAN

▼魔方 西西 提交于 2019-11-30 16:35:33

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!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!