接收打印作业并将其转发到 LAN 中的打印机的软件

Software to receive printjobs and forward them to printers in a LAN(接收打印作业并将其转发到 LAN 中的打印机的软件)

本文介绍了接收打印作业并将其转发到 LAN 中的打印机的软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个软件,Windows 会将其检测为已安装的打印机驱动程序,并在设备和打印机"下列出该软件

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

就像ImagePrinter软件一样,您可以通过以下链接访问它.http://sourceforge.net/projects/imageprinter/

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

当此图像打印机安装在计算机上时,Windows 会将其列在打印机和设备下,以便我们可以右键单击并在我们的网络中共享它.LAN 用户可以将其添加为远程打印机并向其发送打印作业,然后它将这些打印作业转换为图像格式(jpg 等)并保存在指定目录中.

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.

我需要的是从 LAN 上的其他 PC(如 ImagePrinter)获取这些打印作业,并将它们发送到 LAN 中共享的真实打印机,就像从本机发送一样.(就像运行我的软件发送这些打印作业的计算机一样)以便可以打印它们.

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.

要做到这一点,我需要做两件事..1- 以 Windows 将其检测为打印机的方式创建软件(因此可以轻松共享并接收打印作业)

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- 将打印作业发送到已安装的远程打印机,该打印机添加到运行我的软件的机器上,就像机器自己的打印作业一样.

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

我想用c#来做(因为我其余的应用程序代码都是用c#写的,反正如果可以组合在一起,那么编程语言就不是问题了.)

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.)

请给我说明,甚至是一些要阅读的主题.因为我不知道如何构建它.只是信心不足,因为 ImagePrinter 是一个类似的软件.. 所以这项任务是可能的.

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.

提前致谢.

推荐答案

这可以通过正确的方式结合四种成分来完成:

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

  • 带有 PostScript 打印机驱动程序的打印队列设置,在 LAN 上共享;
  • Ghostscript(向下滚动以获取 gs871w{32,64}.exe) 将 PostScript 转换为图像;
  • Redmon(下载 redmon17.zip) 用作打印机端口监视器";
  • 一个 DOS 批处理文件,完全符合您的要求;
  • 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;

打印队列将使用Red-irector Port Mon-itor"将传入的 PostScript 作业引导至您选择的程序/应用程序/批处理脚本.

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. 将传入的 PostScript 作为其输入,
  2. 调用 Ghostscript 命令行将输入转换为您选择的 %imageformat%,
  3. 最后将 %imageformat% 作为作业发送到您选择的打印机.

这是一个文档,描述了一些关于 RedMon 的基本需要知道的事情:

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

  • http://pages.cs.wisc.edu/~ghost/redmon/en/redmon.htm

这里有一些额外的提示:

Here are a few additional hints:

如果您是 Ghostscript 的新手,您可能会遇到最大的问题,即构建一个能够满足您需求的命令行.这里有些例子.

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.

第一个将从标准输入(命令末尾的标准输入,-)到达的数据转换为单页、黑白 TIFF G4,分辨率为 600dpi,其中每个page是一个单独的文件,命名为page_001.tifpage_002.tif等:

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!

这是一个 Ghostscript 命令行,它会生成相同的输出,但这次是单个多页 TIFF G4:

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!

您不想要黑白 G4 TIFF,而是彩色 TIFF、32 位 CMYK?好的,为 Ghostscript 使用不同的输出设备:

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!

你想要JPEG?抱歉,没有多页 JPEG 之类的东西.不过单页没问题:

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!

这篇关于接收打印作业并将其转发到 LAN 中的打印机的软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:接收打印作业并将其转发到 LAN 中的打印机的软件

基础教程推荐