Incorrect margins when printing to a laser printer using CUPS 1.6.x

Bug #1184663 reported by Fiorenzo De Santis
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have a Brother HL-2270DW laser printer and I'm having issues with print margins using the official drivers by Brother after I upgraded to Quantal and these issues still persist with Raring.

Other users reported similar problems with different printers mostly Brother:

http://ubuntuforums.org/showthread.php?p=12381534
http://askubuntu.com/questions/284441/hl-2240-brother-not-printing-at-margins/300186#300186

I have also a Brother MFC-J6510DW inkjet all-in-one printer and it works fine.

I've found out that a workaround for the Brother original driver is to print your document as .ps file and then print that file.

However using some Generic PCL drivers I can get correct margins in particular with Foomatic/ljet4 and Foomatic/ljet4d.

Following directions in Debugging Printing Problems, I've enabled "Save debugging information for troubleshooting" and I've captured a print job. However the captured file appears to be OK whereas the printed file has wrong margins (left +6 mm; top -4 mm).

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: cups 1.6.2-1ubuntu7
ProcVersionSignature: Ubuntu 3.8.0-22.33-generic 3.8.11
Uname: Linux 3.8.0-22-generic x86_64
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
Date: Mon May 27 18:19:24 2013
InstallationDate: Installed on 2013-03-16 (72 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130315)
Lpstat:
 device for BRFAX: lpd://BRW002258EF8326/BINARY_P1
 device for HL2270DW: lpd://BRW00225892D671/BINARY_P1
 device for MFCJ6510DW: lpd://BRW002258EF8326/BINARY_P1
 device for PCL_HL-2X: lpd://BRW00225892D671/BINARY_P1
 device for PCL_HL-2X__Duplex: lpd://BRW00225892D671/BINARY_P1
MachineType: ASUSTeK Computer Inc. U36SD
MarkForUpload: True
Papersize: a4
PpdFiles:
 HL2270DW: Brother HL2270DW for CUPS
 PCL_HL-2X__Duplex: Generic PCL 6/PCL XL Printer Foomatic/ljet4d
 PCL_HL-2X: Generic PCL 6/PCL XL Printer Foomatic/ljet4
 MFCJ6510DW: Brother MFC-J6510DW CUPS
 BRFAX: Brother BRMFCFAX for CUPS
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-22-generic root=UUID=ec9aa77a-fa22-4668-b846-38058c29cf00 ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 07/12/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: U36SD.205
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: U36SD
dmi.board.vendor: ASUSTeK Computer Inc.
dmi.board.version: 1.0
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK Computer Inc.
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrU36SD.205:bd07/12/2011:svnASUSTeKComputerInc.:pnU36SD:pvr1.0:rvnASUSTeKComputerInc.:rnU36SD:rvr1.0:cvnASUSTeKComputerInc.:ct10:cvr1.0:
dmi.product.name: U36SD
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK Computer Inc.

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :
Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

Brother HL-2270DW original PPD

description: updated
Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

is it related to the following old bug?

https://bugs.launchpad.net/poppler/+bug/293832

is the poppler involved?

can we do some tricks to overcome this issue? for example, there is an option to set margin offsets for all the print jobs of a printer?

Revision history for this message
reference2myself (reference2myself) wrote :

Has anyone found a solution to this? I just bought this printer thinking it had good Linux support and I can't get my margins right with any driver/settings. the 2170w driver seems to get them the closest for me but the bottom is still off. The official driver has just about all of the margins off.

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

Many people are affected by this bug but nobody subscribes this bug report, this way it isn't going to be fixed.

Most people prefer generic PCL drivers but with these drivers you can't take advantage of all the features of your printer, in fact you are limited to a 600dpi resolution, you can't use the toner saving etc.

I've tried several generic PCL drivers and the best is Foomatic/hpijs-pcl5e (for HL-2170W), it handles the margins correctly.

However also Foomatic/ljet4 and Foomatic/ljet4d work well with margins.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fiorenzo, first to say is that the problem is not in Poppler, as the PDF->PS transition needed for Brother's driver is done by Ghostscript.

First, follow the instructions of the sections "CUPS error_log" and "Capturing print job data" on https://wiki.ubuntu.com/DebuggingPrintingProblems with Raring and/or Saucy. Please attach the resulting files, one by one, without compressing them and without packaging them together.

In addition, run the command

lpadmin -p HL2270DW -o pdftops-renderer-default=pdftops

in a terminal window and try to print again. Does this fix the problem or at least improve the situation?

To return to the standard configuration, run

lpadmin -p HL2270DW -R pdftops-renderer-default

Changed in cups (Ubuntu):
status: New → Incomplete
Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

captured print job, it seems to be OK

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

scanned output, with wrong margins

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

scanned output, with right margins using Fedora 19

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

however the command

lpadmin -p HL2270DW -o pdftops-renderer-default=pdftops

fixed the problem

I attached the cups error log as well

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fiorenzo, do you have a utility named "brprintconf_..."? Try bu entering

brprintconf

in a terminal window and instead of Enter press Tab, if needed two or three times. If it gets completed or alternatives for completing it get shown, you have such a utility. Then run

brprintconf_<your_model> -pt A4

in the terminal window. In case of errors try to get info via

brprintconf_<your_model> -h

or

brprintconf_<your_model> --help

Or try

sudo brprintconf_<your_model> -pt A4

Replace <your_model> by the completion of the command which you got by pressing Tab in the beginning.

Revision history for this message
Fiorenzo De Santis (fiod3s) wrote :

although undocumented, I was able to run this command

sudo /usr/local/Brother/Printer/HL2270DW/inf/brprintconflsr3 -P HL2270DW -pt A4

however it didn't help, of course I restored the default renderer before trying it

so at the moment only the "pdftops" renderer helps

Revision history for this message
Clayton Wozney (clayton-wozney) wrote :

I have been struggling with this problem for days and the HL2270DW.PPD file provided by Fiorenzo worked like a charm. Thanx!

Adam Porter (alphapapa)
Changed in cups (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Eric Light (rhyven) wrote :

I'm similarly affected, running Linux Mint LMDE 14.03, with a Brother HL-2240D printer.

I'm using the official Brother drivers provided at: http://support.brother.com/g/b/downloadlist.aspx?c=as_ot&lang=en&prod=hl2240d_all&os=128

Using the command posted by till-kamppeter in post #6 resolved the issue.

Revision history for this message
Claude Krantz (puma) wrote :

I have been affected by this for years while printing from Linux (Ubuntu 12.04) via a FreeBSD (9.2 for what matters) CUPS server (versions 1.5.x to 1.7.x at least). I have two printers: HP Laserjet 1320 and HP Deskjet 5550 which are installed via CUPS on the FreeBSD server and shared with the Linux CUPSes (1.5.3 from precise).

Printing via the Foomatic/HPIJS drivers "HP-LaserJet_1320-hpijs.ppd" and "HP-DeskJet_5550-hpijs.ppd" always gave me unacceptably wrong printout margins (shifted more than 1 cm right and up). The generic PCL driver provided by CUPS never had this problem, but of course would not take advantage of any advanced printer features.

Running the command hinted by Till in post #6

lpadmin -p <printer_queue> -o pdftops-renderer-default=pdftops

on the FreeBSD server (NOT on the Ubuntu Linux clients!) for every printer installed there solved the problem completely. Many thanks for that. The server now runs CUPS-1.7.2 and shares its printers with the Linux CUPS-1.5.3 via cups-browsed in total harmony and I always get correct margins.

Let me emphasise once more that in my case this bug was NOT caused on the side of Ubuntu 12.04 (CUPS 1.5.3 ) but on the side of the FreeBSD server (CUPS 1.7.2). However this seems to suggests that the root of the issue goes upstream ...

Revision history for this message
Anon N (anonn) wrote :

The bug or rather feature is located in the postscript conversion script '/usr/local/Brother/Printer/HL2270DW/lpd/filterHL2270DW' on line 23. When the variable PCL is set to '1', device dependent instructions are enabled within the script, sent before the actual postscript data, and thus the printing begins at the new printable area as indicated by the coordinates as defined in the conditional if block starting on line 108.

Interesting and short read on the differences between PCL and PostScript:
http://www.laserquipt.com/support/idx/0/063/article/PCL-vs-Postscript.html

Revision history for this message
Christopher (soft-kristal) wrote :

When I print a PDF from Evince I get a large top margin which cuts of the top and bottom text, even when reduced to 90%.

Printing from qpdfview lets me adjust the margins in Properties and the document prints properly. Given this, it seems to be an Evince and other applications bug with a lack of advanced settings prior to printing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.