CUPS margins runneth over

I have a Brother HL-5070DN printer at home. It has the three things I wanted in a printer:

and it was pretty inexpensive. Generally speaking, it’s been working fine, but there’s been one oddity that I couldn’t figure out. Whenever I printed something through the lpr command on my Mac—lpr is part of the CUPS printing system—I’d get too much margin at the top of the page. This never happened when I printed using a more Mac-normal program, like Preview, only from lpr. And it never happened when I used lpr to print to the printer at work, an HP LaserJet 2200dn.

(If you’re curious why I use lpr at all, you can look at this page, or this one, or this one. Basically, I’ve written several command-line utilities over the years that help me format and print out things like file folder labels, address labels, and envelopes. Part of the efficiency of these utilities is that they send their output straight to the printer.)

Until the last couple of days, I haven’t really needed to print from lpr at home, so this problem was definitely back-burner. But as I anticipate a change in my printing habits, the problem had to be solved.

Tonight I decided to look into the printer’s PPD file. This file sits in the /etc/cups/ppd folder and is just a text file. I opened it in TextMate and started scrolling through, hoping that something obvious would jump out at me. It did. All of the defaults for page size and image size were set to A4 instead of Letter. Since A4 is about 3/4″ taller than Letter and the origin of the PostScript coordinate system is at the bottom left of the page, everything would print about 3/4″ lower than expected.

There are four parameters in the PPD that affect this: DefaultPageSize, DefaultPageRegion, DefaultImageableArea, and DefaultPaperDimension. I changed them to Letter and now all’s right with the world—things print where they’re supposed to no matter which program I use to print.

I’m not sure whether to blame Apple or Brother for this. OS X Tiger comes with a PPD for the 5070DN, but it might have been overwritten by software I installed when I got the printer. Either way, it’s curious that a Eurocentric setting like this would show up in printer driver or operating system intended for the US market. Creeping Frenchification, I say.

Update: After writing this, I surfed over to to see what’s hot today. Since I was in a “print problems” frame of mind, this link caught my eye. Seems like the experts at Smart Computing have two main solution techniques:

  1. Restart your computer.
  2. Restart your printer.

For really tough problems they suggest doing both, which I guess is the sign of true expertise.