PCLdiet for HP LaserJets and Compatibles


What is PCLdiet

PCLdiet shrinks the size of PCL files by using PCL more efficiently. It generates a "skinny" PCL file by replacing portions of your original "fat" PCL file with PCL box draw commands, plus using other PCL tricks to reduce the size of the remaining font data and raster graphics data. Your original file remains untouched, and the "skinny" PCL file is written as a separate file. "Fat" PCL files can contain raster graphics, embedded fonts (either bitmapped or TrueType), or literal data.

For large "fat" PCL files (>500 Kbytes), 60% - 70% reduction in size is typical. If your "fat" PCL file contains lots of straight lines and boxes, up to a 90% reduction in file size can be obtained.

PCLdiet handles multi-page documents -- all pages are compressed and written to one output file.

NEWFor you PICK developers! PCLdiet can now eliminate pesky CHAR(255) bytes in the "skinny" PCL file by writing the graphics in 2 parts where needed. The printed output looks the same, and you still get the advantage of a smaller PCL file.


Why Use PCLdiet

PCLdiet creates a much smaller "skinny" PCL file that the LaserJet can print, giving you the same printed output as the "fat" PCL file. Here are some reasons you would want a "skinny" PCL file:

* With a smaller PCL file, less data needs to be transmitted to the printer to get the same printed output. A PCL file that is 70% smaller will print about 70% faster.

* If you keep your PCL files on disk because you print the same things many times (i.e., blank forms, letterheads, stock letters), having skinny PCL files will greatly reduce the amount of disk space needed. Even if you keep your PCL files in a .ZIP format, a zip file of a skinny PCL file may be smaller than a zip file of a fat PCL file.

* If you use printer macros, making skinny PCL files out of your macros will use a lot less printer memory to store. This frees more of your printer memory for other things like graphics and fonts.

You would not use PCLdiet if you needed to print something just once. PCLdiet usually takes 2 - 3 minutes (Pentium CPU) to compress one graphics page into a skinny PCL file. PCLdiet is much more suited to compressing something that needs to be printed over and over -- using PCLdiet means spending a little CPU time up-front creating the skinny PCL file, but saving lots of time later on each time that file is printed.


Using the PCLdiet Program

PCLdiet is a DOS product. All program options can be specified on the command line so that it is easy to set up a batch file to compress an entire directory's worth of graphic print files all at once. Syntax is:

PCLdiet [filename] /options

where "[filename]" is the print file containing your original PCL printout; lets call that the "fat" PCL file. "/options" can be any one of the following:

   /h or /?    Display help message
   /r          Boxes + PCL4 compression
   /3          Boxes + PCL5 compression
   /4          Boxes + PCL5e compression
   /minboxsize=###   Minimum size of a rectangular area to be written as
                     a box draw command
   /embedded=###     (used only with /r option) Minimum number of embedded
                     nulls to trim
   /v          Use relative positioning
   /w          Make a Windows-compatible .BMP file from your print file
   /t          (used only with "/w" option) Trims rows and columns around 
               your .BMP file

Let me explain these options. Various models of LaserJets support different compression schemes, with later models supporting more efficient schemes. Here are the options you would choose for the various models:

   For LaserJet II family (PCL4):       PCLdiet [filename] /r
   For LaserJet IIp family (PCL4e):     PCLdiet [filename]
   For LaserJet III family (PCL5):      PCLdiet [filename] /3
   For LaserJet 4 & 5 family (PCL5e):   PCLdiet [filename] /4

Note that the default is to use mode 2 compression compatible with the LaserJet IIp family. You will need to generate skinny PCL files according to one of these strategies:

* Generate skinny PCL files compatible with the lowest common denominator LaserJet model that you or your users will be using. This usually means a LaserJet II (PCLdiet /r)

* Generate 4 separate libraries of skinny PCL files, and distribute to each user a library corresponding to what model LaserJet they have.

Once you select whether to use the "/r", "/3" , or "/4" options, the "/minboxsize" and "/embedded" options fine-tunes the shrinkage algorithm. You don't *need* to specify these options since the default values work pretty well, but you may want to experiment.

"/minboxsize=###" controls how big in bytes a rectangular black area needs to be before PCLdiet writes it as a box draw PCL command. The default is "/minboxsize=55".

"/embedded=###" controls how many consecutive null bytes in a raster row will cause PCLdiet to split the raster row into two portions, skipping the null bytes in the middle. The default is "/embedded=6".

The "/v" option will write the skinny PCL file using relative positioning only. Use this if you may want to print your skinny graphic in different locations on the page in different documents -- an example would be a signature graphic. If you omit the "/v" option, the skinny PCL file will be written using absolute positioning.

An auxilliary feature of PCLdiet is that you can write the graphics portion of your fat PCL file as a Windows-compatible .BMP file. You can then edit the .BMP file using PaintBrush, etc. Select this feature with the "/w" option. If you select the "/w" option, you can also select the "/t" option. "/t" will trim blank rows and columns from around the edges of your .BMP file. If you omit the "/t", you will get a full page .BMP so that you can add more stuff around the edges. No skinny PCL file will be generated if you use the "/w" option.

Only the graphics portion of your fat PCL file can be written as a Windows-compatible .BMP file. Fonts and literal data will not be included unless they are formed only with PCL raster graphics commands.

A batch file can be easily set up to compress an entire directory's worth of fat PCL files. Here is a batch file that writes a skinny PCL file for a LaserJet 4, using a nondefault minboxsize. It assumes all your fat PCL files have the ".pcl" file extension:

for %%f in (*.pcl) do PCLdiet %%f /4 /minboxsize=101

Skinny PCL files are always written with the file extension ".all". So a fat PCL file "page1.pcl" is written as the skinny PCL file "page1.all".


Sample Files

Below are some sample files you can download and see for yourself the dramatic file size reduction that is possible by letting PCLdiet use PCL more efficiently. All files are in .ZIP format. Download the "fat" PCL file, then download whichever "skinny" PCL file corresponds to the model LaserJet you have. (NOTE! All files below have been zipped, so the download size of each file is about 60 Kbytes.)

Skinny PCL files are upwardly compatible across the family of LaserJets. So, a skinny file for the LaserJet II can be printed on a LaserJet II, III, 4, or 5. But a skinny file for the LaserJet III cannot be printed on a LaserJet II.

Fat PCL file, 749518 bytes unzipped.

Skinny PCL file for LaserJet 4 & 5 family, 84824 bytes unzipped, an 88.7% reduction in file size.

Skinny PCL file for LaserJet III family, 93086 bytes unzipped, an 87.6% reduction in file size.

Skinny PCL file for LaserJet IIp family, 141392 bytes unzipped, an 81.1% reduction in file size.

Skinny PCL file for LaserJet II, 167447 bytes unzipped, a 77.7% reduction in file size.

Once you download these files, you can unzip them and print them all in one step by using the pkunzip -pb1 command.

The sample is a scanned tax form. Although to the naked eye it contains many lines and boxes, at the printer dot level the lines in the fat PCL file are not perfectly straight. This reduces the compression ratio that PCLdiet can achieve.


Is PCLdiet Right for You?

Wondering if PCLdiet will work with your PCL files? Give it a free test. E-mail me one PCL file, I'll run it through PCLdiet, and e-mail the resulting skinny file back to you. See for yourself the shrinkage PCLdiet can give you.


Other Shareware and Font-Related Products

* Handwriting Fonts

* Logo Fonts, Signature Fonts

* Font Editor for LaserJet Bitmapped Fonts

* TrueType to LaserJet Bitmapped Font Converter

* UUencode & UUdecode. Translates binary files to/from ASCII so they can be e-mailed across mail systems that otherwise corrupt binary mail. Source code available -- can easily be incorporated into Visual Basic projects. Source code available -- can easily be incorporated into Visual Basic projects.

* QuickBasic math expression evaluator, with source code, evaluates a mathematical expression in QBasic format and returns the numeric answer. Source code available -- can easily be incorporated into Visual Basic projects.


Further Information

The cost of PCLdiet is US $199.

Visa Mastercard
Visa & Mastercard are accepted through the PayPal on-line payment system. There is no extra cost to you to use PayPal, and for a limited time PayPal will give you a credit of $5 for signing up with them. You don't need to order any of my products to claim your $5 credit. NOTE: The PayPal site will open in a separate browser window.

I also accept company or personal check drawn on a bank in the USA in US dollars, money order, traveler's checks, cash, Western Union wire transfer (call for details), or COD via US Mail.

For further information, contact me at the address, or phone number below, or
Mailbox send me e-mail now.

Alexander Walter
P.O. Box 741
Middletown, NJ.  07748

(800) 262-0827   (USA & Canada only)
(609) 504-4804   (elsewhere)
(708) 575-3865   (fax)

Need an unzip program? Download either: pkzip/pkunzip for DOS or Windows, or ZipIt 1.35 for Macintosh.

Internet Link Exchange
Member of the Internet Link Exchange

SafeSurf Rated All Ages We rated with RSACi!

Handwriting Fonts and Other Font Products / Alexander Walter / adw@execpc.com