views:

36

answers:

2

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

+2  A: 

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:

  • PDF, some printers support rendering PDFs directly.
  • XPS, Microsoft's XML Paper Specification.
  • TIFF, a bitmap-only page representation.

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.

dreamlax
Thanks for the answer. I'm trying to add printing functionality for an existing OpenVG implementation (it uses OpenGL as screen rasterizer), so I think avoiding GDI and working on PDL level is good idea.
noober
A: 

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.

Mark Ransom