The Linux printer setup dialog can install zillions of drivers
from the printer database and print nice test pages to verify the
driver works, but what if it doesn't work? What if the margins are
way off (or even only a little off, but you need to print labels or
forms with exact alginment)? I recently replaced my ancient HP
LaserJet 6L (which died after many years of service) with a Brother
HL-2040, and the default alignment was pretty awful with the
recommended driver, so I tried to recall how to use the
Squirreled away in the obscure Open Printing
Downloads web site are two files which are handy for tweaking
your printer driver. The
To use these files, put them both in the same directory, then run
The first copy of the file you get will be almost totally useless, but you can read the instructions that print with the other gibberish and realize you have no idea what it says. In any case, after generating the printout, the script will ask you for a bunch of numbers. This first time through, you want to tell it 0 (zero) for all the values.
The script will edit the
For general paranoia, I always restart the cups system
service after each run of the
Anyway, now that you have the new printout based on all zero margins, it is time to get the most accurate ruler you can find and measure the H and V values. There are arrows labeled H and V on the printout, but they can't show the actual length you need to measure because your printer probably cannot print all the way to the physical edge of the paper. The values you want to measure are the length in inches from the physical edge of the paper to the vertical line on the left (H) and the physical bottom of the paper to the horizontal line on the bottom (V). These values will be close to one inch, but the exact difference is the important part to get as accurately as possible.
Once you have measured H and V, the instructions printed near the top of the page give the formulae for computing x and y from the H and V values (expressed in inches). In my case, the formulae are:
x = (1 - H) * 1200.0, y = (V - 1) * 600.0
The actual numbers probably depend on the resolution of the printer.
Now you can run
At this point, you are ready to read off the ml, mb, mr, mt value, which you get by examining the funny looking printout. There are numbers and tick marks along the edge of the inner rotated rectangle that appears on the page. The edges of the rectangle are clipped somewhere as it runs into the margin. The numbers you want to read off for each edge is the number where the clip happens. Once again, you want to read these as accurately as possible. Maybe get out a magnifying glass and a ruler to estimate the exact fractional position of the place where the margins were clipped. The number you pick off the left margin is ml, the bottom margin is mb, the right margin is mr and the top margin is mt.
Plug these new values in for the 1st 4 numbers, and the same
values for x and y you computed above, and you should
now have your
Note that if you run