简体   繁体   English

Linux 打印文档到标准输出或文件

[英]Linux print document to standard output or file

Is there any possibility to print document in Linux to standard output, formed for later sending directly to printer's queue and is there any generic format, suitable for all network printers?是否有可能将 Linux 中的文档打印到标准输出,形成以后直接发送到打印机队列,是否有任何通用格式,适用于所有网络打印机?

Indeed, I do need to do the following process:确实,我确实需要执行以下过程:
1. Print doc to the above mentioned formatted output (or file). 1. 将 doc 打印到上述格式化输出(或文件)。
2. Transfer this to the remote device. 2. 将此传输到远程设备。
3. Send this to the Printer. 3. 将其发送到打印机。

Some more details: Document is printed on one hardware Server, being sent to some Device with no printer Driver (so, it Detects printer as a Network device) and then send the Document to queue as a TCP client.更多细节:文档在一台硬件服务器上打印,被发送到某个没有打印机驱动程序的设备(因此,它将打印机检测为网络设备),然后将文档作为 TCP 客户端发送到队列中。

There is no format all printers understand, other than plain text of course.除了纯文本之外,没有所有打印机都能理解的格式。 Which has nothing to do with Linux, really.这与 Linux 无关,真的。 But if you're willing to include some processing in step 3, sure, just write pdf or postscript and send that through the standard printer queue.但是,如果您愿意在步骤 3 中包含一些处理,当然,只需编写 pdf 或 postscript 并通过标准打印机队列发送。

I would recommend that you print to PostScript or PDF.我建议您打印为 PostScript 或 PDF。 For example, here is a CUPS PDF printer .例如,这里是CUPS PDF 打印机 Another way to do it would be to write your own backend.另一种方法是编写自己的后端。 Here is an example of how to write a CUPS backend in a shell script .以下是如何 在 shell 脚本中编写CUPS 后端的示例。

is there any generic format, suitable for all network printers?是否有适用于所有网络打印机的通用格式?

No. Some printers will understand PostScript, others will understand PCL, and others will require other specific formats.不可以。有些打印机可以理解 PostScript,有些打印机可以理解 PCL,有些打印机需要其他特定格式。 There is no "lingua franca" in the printer world as far as hardware is concerned, which is why you must go through a print manager.就硬件而言,打印机世界中没有“通用语言”,这就是您必须通过打印管理器的原因。

Is there any possibility to print document in Linux to standard output, formed for later sending directly to printer's queue是否有可能将 Linux 中的文档打印到标准输出,以便稍后直接发送到打印机队列

Since there is no common printing format, you can't make such a document.由于没有通用的打印格式,因此您无法制作这样的文档。 The simplest thing on Linux is to print either to PostScript or to PDF, and feed that again to CUPS (or any other print manager you use) when you want to output on a specific printer. Linux 上最简单的事情是打印到 PostScript 或 PDF,并在您想在特定打印机上输出时再次将其提供给 CUPS(或您使用的任何其他打印管理器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM