CUPS Printing – How to Set the Minimum Margin in CUPS / Foomatic Driver

cupsdriversprinterprinting

I have a Dell 2130cn laser printer which has no PPD print driver for CUPS, so I used the generic foomatic PCL6 (/pxlcolor if that matters), and it's not correctly recognizing my printer's print margins and so forcing it to use 0.5" for top and bottom, and 0.25 for left and right.

How do I manually tell either CUPS or the foomatic driver that I my printer actually has 0.1" print margins?

Best Answer

It turns out that the problem is not with the hardware margins in the printer; the page definitions in the ppd file had set a printable area with 0.5" and 0.25" margins for a letter page.


To fix this, edit the ppd for the printer (/etc/cups/ppd/yourprintername.ppd):
Find the list of *ImageableArea definitions of page sizes:

*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea 11x17/11x17: "18 36 774 1188"
*ImageableArea A3/A3: "18 36 824 1155"
*ImageableArea A5/A5: "18 36 403 559"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"

Find the paper size you want to modify the margins for and change the definition (the part in quotes) to match your printer's actual print margins:

Format: "<bottom-left x> <bottom-left y> <top-right x> <top-right y>"

Margin + printable area must remain constant
For me 72 units = one inch (so 0.1" is approximately 8 units)

So:

*ImageableArea Letter/US Letter: "8 8 604 784"

gives the desired 0.1" margin on the print area

Related Question