Lexmark B2865 Printer Languages and Interfaces Technical Reference - Page 38
Group 3 and group 4 raster compression, 02 0002'x 'F9FF 'x, b1002M, r256S, b9645W
View all Lexmark B2865 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 38 highlights
Printer Control Language (PCL) emulation 38 '02 0002'x 'F9FF 'x ESC*rB |TIFF: 8x'FF'x |End graphics Zlib Zlib is a generic compression method. It refers to a standard for compression and the library that implements the standard. The zlib compression method uses the deflate algorithm. This same algorithm is used by more widely known compression utilities such as PKZIP and GZIP. Compressed data is a series of variably sized blocks. An encoder determines how to break the data into blocks and finds the best compression method to use for each block. An encoder works based on the following principles: • The encoder creates a dictionary containing different characters in a set of data. Short strings of bits represent more commonly occurring characters, and long strings of bits represent less frequently used characters. • A probability tree determines which characters are frequently used. • Repeated patterns in a string of characters are identified and stored to avoid storing the string multiple times. A three-bit zlib header is added to the beginning of a block to describe the type of compression used. The header also indicates whether the block is a final block. Other information in the header includes checksums, compression algorithm used, and the level of compression. In compression, all checksums are set to zero, and in decompression, the checksums are ignored. The memory required for zlib compression and decompression is independent of the size of the data for compression or decompression. The number 999 is used to represent zlib compression because it does not conflict with other compression types. Group 3 and group 4 raster compression Since group 4 images do not use line endings, the width of the image must be specified using the Raster Width command (ESC*r#S). Send the compressed image data to the printer using the Transfer Raster Data command (ESC*b#W). The maximum number of bytes that can be sent using the command is 32K bytes. Break up images larger than 32K bytes and send them using multiple commands. It does not matter where the image is broken, or how many Transfer Raster Data commands are used. When the image is started (with a Transfer Raster Data command), no other commands are allowed until the entire image has been sent. The following example prints a group 4 image file that is 256 bits wide and 9,645 bytes long: ESC*b1002M ESC*r256S ESC*r1A ESC*b9645W ...[Group 4 image data]... ESC*rB |Set raster compression to group 4 |Define width of image in input bits |Start raster graphics at current position |9,645 bytes of a group 4 image |End raster graphics