打印机通用接口
现在常见的打印机接口是什么?我读过其中大多数都支持 PostScript 和/或 PCL。我应该如何从应用程序代码中使用 PS/PCL(例如,在 Win32 下)?
What is a common printer interface today? I've read most of them support PostScript and/or PCL. How should I use PS/PCL from an app code (say, under Win32)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,PostScript 和 PCL 都是开放规范。 PostScript 的权威来源是 PLRM (PostScript 语言参考手册)。 PCL 的等效项可以在此页面找到。
大多数用于办公环境的现代多功能打印机都接受多种不同的 PDL。 PostScript 和 PCLXL 是最常见的,但其他一些是:
许多制造商还实施专有的 PDL。由于 PostScript、PDF 和 XPS 的解析和渲染速度可能很慢,因此制造商通常会实施针对打印机硬件和固件进行优化的专有 PDL。只有使用制造商定制的 PDL 驱动程序,才能实现许多制造商额定的每分钟页数。这种技术也被低端预算打印机使用,这些打印机的硬件无法解释高级 PDL。
在生成此输出方面,通常您不需要这样做,而是应该通过 Windows GDI,或根据您的目标操作系统,GDI+.您的绘图和文本输出例程将由打印机驱动程序处理,而打印机驱动程序又会为特定打印机生成输出。还有通用驱动程序(Microsoft 包含通用 PostScript 打印机驱动程序),可用于生成不特定于任何特定打印机的输出。
PostScript and PCL are both open-spec as far as I am aware. The definitive source for PostScript would be the PLRM (PostScript Language Reference Manual). PCL's equivalent can be found at this page.
Most modern multi-function printers for office environments will accept a number of different PDLs. PostScript and PCLXL are the most common, but some others are:
Many manufacturers also implement a proprietary PDL. Since PostScript, PDF and XPS can be slow to parse and render, a manufacturer often implements a proprietary PDL that is optimised for the printer's hardware and firmware. A lot of manufacturer-rated page-per-minute counts are only possible if you use their custom PDL driver. This technique is also used by low-end budget printers where the hardware is incapable of interpreting high-level PDLs.
In terms of generating this output, usually you do not need to do so, instead you should go through Windows GDI, or depending on your target OS, GDI+. Your drawing and text-output routines will be handled by a printer driver which in turn will generate output for a specific printer. There are also generic drivers out there (Microsoft includes a generic PostScript printer driver) that can be used to generate output that is not specific to any particular printer.
在 Windows 中,您通常使用 GDI 并让打印机驱动程序将其转换为实际的打印机语言。这为您提供了完全的设备独立性。
In Windows, you generally use the GDI and let the printer driver translate it to the actual printer language. This gives you complete device independence.