Printer Languages ​​and Technologies

image

Today, the printer is not much different from a computer. It has a processor, memory, operating system and read-only memory. If the printer is a network printer, then it has a network card and a web server that allows it to be administered. Printers not only support different network protocols, but also accept tasks in specific languages ​​that describe the layout of pages and documents. Thus, in a large enterprise, printing software must interact with different hardware implementations of the printing protocol, possibly even unknown. Configuring printer printing is harder than it first appears. Users take printing for granted, however, to get a quality result, you need to go through more than one step.

In this article, I propose to consider and compare the printing technologies that you encounter when choosing a new printer, conducting prepress preparation of a document or working with electronic PDF copies of documents. And of course, if you are trying to intercept and analyze a print job.

About printer languages


What is a print job? This is a program written in a special programming language - Page Description Language (PDL).

Printed pages are encoded in PDL and are smaller, which means they are transmitted faster than raw images. PDLs are independent of both the devices themselves and the resolution. Printers convert jobs in a specialized language into a device-friendly format. This means that printers contain language interpreters. Just like the programming languages ​​“a la Java”, these languages ​​have more than one version and each one works in its own way.

Converting PDLs to bitmaps is done by a processor program: a bitmap processor, Raster Image Processor, or just RIP.

The most famous PDL languages: Postscript, PCL5, PCL6

Many printers understand more than one language. But if you send the program in a different language, printing cannot be completed - the compiler is not the same.

PostScript is the most common of all. Originally developed by Adobe. It requires a license to use, so today it is mainly used in high-performance devices of the upper price segment. Almost all programs that compose pages can generate PostScript jobs. This is a fully functional programming language. Written programs can be viewed using a text editor. They have many parentheses as well as /% characters!

PS These characters are searched for by interpreters to recognize print jobs.

PostScript example:

%!PS-Adobe-3.0 EPSF-3.0
   %%Creator: [generally the program that generated the postscript]
   %%Title: [descriptive name or just the file name]
   %%CreationDate: [date the file was created]
   %%DocumentData: Clean7Bit
   %%Origin: [eg: 0 0]
   %%BoundingBox: xmin ymin xmax ymax
   %%LanguageLevel: 2 [could be 1 2 or 3]
   %%Pages: 1
   %%Page: 1 1
   %%EOF

PostScript is also the standard for MAC and the professional standard.

PCL - or Printer Common Language - is an alternative to PostScript from Hewlett Packard (hereinafter HP). The language is understandable to printers from other manufacturers, some can only work with it. PCL is not a programming language; it simply tells the printer how it should print pages. Jobs on PCL are binary and incomprehensible to humans, but shorter in size than PostScript.

There are filters that convert Postscript to PCL. PCL versions do not vary as much as PostScript, but enough to be annoying. Jobs print slightly differently on different printer models. The reason is in dialects with special teams. Unlike PostScript, PCL was originally designed specifically for managing the printer, and not for page portability, therefore, to achieve the best print result, you must use the commands for the corresponding printer. That is why the printer model is indicated in the operating system (OS), otherwise other PCL commands are generated that are interpreted incorrectly or completely ignored.

In fact, the question is not only in hardware: there is so-called emulation.

PCL emulation- this means that the developer of the standard (i.e. HP) has not licensed or tested the manufacturer’s printer for PCL compatibility.

PostScript emulation - Adobe did not receive royalties for its PostScript interpreter; instead, some vendors wrote their own code. Licensing policies gave rise to dialects of languages ​​- similar, but not repeating the original exactly. In practice, both may fail with error, but this rarely happens.

To completely confuse you, HP has identified two language families: PLC5 (5e is black and white and 5c is color) and PCL6 (PCL / XL). Newer HP printers support both. Previously, PCL4 also existed, but now it is too archaic. Starting with PCL5 5e, innovations have also been introduced such as: support for 600 dpi resolution, bidirectional data exchange between the printer and the computer, and new fonts for Microsoft Windows.

PCL5 example:

^[E^[&11o0o1t016D^[&11X^[*r0F^[*r0F^[*v0n1O^[*p4300X^[%1BDT~,
00a4b100g2P^[*v1O^[*c899a154b10g2P^[*v1O^[*p346Y^[*p256X

PCL6 example:

A’X^BX^BA.<89>A^@A.<86>A^CA.<8f>AA^@A.<88>A^AA.
Af^@^@A.A.dA^A:^@

PDF is another Adobe development - Portable Document Format. This is a document format that uses part of the capabilities of PostScript, the foundation of publishing and Office programs. PDF documents are OS and platform independent. Very often, the format is used for exchanging documents with the ability to view and print. PDF is a language for describing documents, not pages. Allows you to describe not only pages, but also the entire structure of the document, chapters, the relationship of text columns with each other, edits, and so on. Plus, a bunch of multimedia features.

There are printers that interpret the PDF directly. There are many translators and visual editors with the ability to convert PDF, for example, to PostScript. This conversion can even be hidden from the user.

PDF example:

PDF:
%PDF-1.4
%A.A.AA”
81 0 obj
<<
/Linearised 1
/O 83
/H [915 494]
/T 125075
>>
Endobj
Xref
81 24

XHTML - appeared relatively recently. The printer receives a data stream in a language that describes the XHTML-print web page, generates a job representation (different printers generate different jobs, just like different browsers reflect the page differently).

HP-GL / 2 - Hewlett-Packard Graphics Language - Used to print vector graphics as part of a document.

HPGL is a plotter support language. Supported by almost all HP printers.

PJL - Printer Job Language. The job language for the printer, the metalanguage from HP, describes which PDL should be used for the job, what the paper size will be, how many copies you need to print, a simplex job or a duplex job, and so on.

PJL example:

@PJL SET DUPLEX=ON
@PJL SET PAGEPROTECT=OFF
@PJL SET COPIES=3
@PJL ENTER LANGUAGE =PCL

About drivers


Printer driver and support - software that converts a file into a printer-friendly file. The tasks and functions of the driver answer the questions: “What if the printer does not support all languages?”, “There is a postscript job, and the printer only recognizes PCL 5E. "I need to print a PDF, what if the printer does not interpret it?"

The system will be able to do everything on its own (find out the language of the PDL file, perform conversions). You can also convert the file manually. Browsers can convert HTML to postscript or PDF. Open Office can convert .doc to PDF. From postscript can be converted to almost any format, including PCL.

Gdi- Another print job can be viewed and interpreted centrally, on a PC. You can also send finished processed bitmap images to the printer “without intelligence”. That is how many Windows GDI printers work. Such printers have a very small number of logical instructions and do not have PDL interpreters at all. Instead, the rasterization is performed by the host computer. Part of the information for interacting with GDI is hidden in the Windows code under patents. This secrecy makes it difficult to develop analogues on Linux systems, and, in fact, is an advantage. Similarly, the situation is developing with the support of the latest printer models. However, the situation is changing due to the existence of the CUPS daemon with support for many Win Printers using reverse engineering.

About the print server


A bit of fun about CUPS and sending print jobs through it. This print server is based on IPP, which is the well-known HTTP overload. Inquiries about the status of printers go as an HTTP GET operation, and print jobs through HTTP POST. Thus, CUPS is, in fact, a web server, but communicates exclusively on port 631, not 80. CUPS is perhaps the most complete IPP implementation on the planet, and its configuration files are very similar to the Apache web server files. And, of course, it allows printing systems to use authentication, access control and encryption technologies.

In Windows, printing through IPP appeared since Windows 2000. On clients with Windows 7 and later, IPP support is usually already installed. There is also Internet Printing - windows implementation of the Internet print server through IPP. To install it, you must first install the MS IIS web server service

About security for printers


Network printers, of course, support their remote control systems, the configuration and monitoring are mainly carried out either through the IPP protocol, or through SNMP, or from a web browser via HTTP. In particular, having access to the printer, you can get such parameters as: IP addresses, standard gateway, Syslog server, SNMP group name (password), protocol options, administrator password. Here, unauthorized access attacks via SNMP and DDOS attacks are possible. Almost all printers that can be remotely administered are insecure and use the password or SNMP name given at the time of installation.

What operating system is the printer using? Some models have a Linux-based distribution on board. You can understand what is installed on the printer or change the default passwords only by digging into the manufacturer’s documentation. The confusion with the operating system is aggravated by the fact that graphical administration tools tend to hide information about differences between manufacturers.

In conclusion, I want to say again that the problems of the press are multifaceted, some of which are left out of the scope of the article. Next time I hope to talk about journaling, PPD files and paper sizes. About how to ask a monochrome printer to print a two-sided color document in an unknown b4 format, as well as about all kinds of printing utilities and compatibility commands.

Article author: Timur GaliulinGtrch

All Articles