Printer output on wrong paper size

Bug #82265 reported by Nicholas Wastell
2
Affects Status Importance Assigned to Milestone
cupsys (Ubuntu)
Invalid
Undecided
Pascal De Vuyst
Nominated for Dapper by Pascal De Vuyst
gutenprint (Ubuntu)
Fix Released
Undecided
Pascal De Vuyst
Nominated for Dapper by Pascal De Vuyst

Bug Description

Binary package hint: cupsys

(Printingbuginfo.txt below) I'm not sure that this is a CUPS problem, but I can't narrow it down. This is not another report of the wrong _default_ paper size -- output is printed ignoring the paper settings.

All paper sizes are set to A4 (application, printer defaults), but output is scaled to fit US-Letter at the printer (Epson Stylus C86). Most noticeable is output from gLabels, where printed scale and position are critical.

Output to a Samsung printer is correct; output to cups-pdf virtual printer is correct.

Problem only appears when printing from an application using Gnome printing. Other printing methods do not show this problem (e.g., OOo, Acroread).

During problem diagnosis attemps, I printed from gLabels to <generic ps> and viewed the ps file in Evince: scaling was correct. I then printed to the Epson printer from Evince and the page was scaled down to fit US-Letter. Part of the cups error log (debug mode) includes this:

D [27/Jan/2007:15:58:36 +0100] [Job 137] Copying page 1...
D [27/Jan/2007:15:58:36 +0100] [Job 137] pagew = 595.0, pagel = 842.0
D [27/Jan/2007:15:58:36 +0100] [Job 137] bboxw = 595, bboxl = 842
D [27/Jan/2007:15:58:36 +0100] [Job 137] PageLeft = 0.0, PageRight = 595.0
D [27/Jan/2007:15:58:36 +0100] [Job 137] PageTop = 842.0, PageBottom = 0.0
D [27/Jan/2007:15:58:36 +0100] [Job 137] PageWidth = 595.0, PageLength = 842.0
D [27/Jan/2007:15:58:36 +0100] [Job 137] Wrote 1 pages...
.
.
D [27/Jan/2007:15:58:36 +0100] [Job 137] Gutenprint CUPS option 4 PageSize = A4

Correct so far. Then:

D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsEncodeLUT[0] = 0
D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsEncodeLUT[65535] = 1
D [27/Jan/2007:15:58:36 +0100] [Job 137] num_components = 1, depth = 1
D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsColorSpace = 3, cupsColorOrder = 0
D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsBitsPerPixel = 1, cupsBitsPerColor = 1
D [27/Jan/2007:15:58:36 +0100] [Job 137] max_gray = 1, dither_grays = 2
D [27/Jan/2007:15:58:36 +0100] [Job 137] max_color = 0, dither_colors = 0
D [27/Jan/2007:15:58:36 +0100] [Job 137] cache_size = 8388608
D [27/Jan/2007:15:58:36 +0100] [Job 137] cups->header.Duplex = 0
D [27/Jan/2007:15:58:36 +0100] [Job 137] cups->page = 1
D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsPPD = 0x8685b50
D [27/Jan/2007:15:58:36 +0100] [Job 137] cupsPPD->flip_duplex = 0
D [27/Jan/2007:15:58:36 +0100] [Job 137] width = 850, height = 1100
D [27/Jan/2007:15:58:36 +0100] [Job 137] PageSize = [ 612 792 ], HWResolution = [ 100 100 ]
D [27/Jan/2007:15:58:36 +0100] [Job 137] HWMargins = [ 0.000 0.000 0.000 0.000 ]
D [27/Jan/2007:15:58:36 +0100] [Job 137] matrix = [ 1.389 0.000 0.000 -1.389 -0.000 1100.000 ]

Note the line which starts "PageSize = [ 612 792 ], ...". That is the size of US-Letter, not A4. Further down the cups error log:

D [27/Jan/2007:15:58:36 +0100] [Job 137] Updating PageSize to [612 792]...
D [27/Jan/2007:15:58:36 +0100] [Job 137] size = Letter

Problem also occurs with LiveCD of Ubuntu 6.06.1 and 6.10, so I'm confident I haven't broken anything. I also tried cups 1.2.7 -- no change (backed out after testing). Upgrade to Ghostscript 5.0.0. final had no effect. Versions 2.1.2 (dapper repo) and 2.1.3 of gLabel show the same problem (but it is not a gLabel bug).

== System information ==
Ubuntu Release: 6.06 (dapper)
Architecture : i686
Kernel : 2.6.15-27-386
Locale : LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8, LC_PAPER=en_GB.UTF-8
/etc/papersize: a4

== Configured printers ==
ML-1210: Samsung ML-1210 Foomatic/gdi (recommended)
Stylus-C86: Epson Stylus C86 - CUPS+Gutenprint v5.0.0
vPDF: Generic postscript color printer rev4
device for ML-1210: smb://MOGGY/Laser
device for Stylus-C86: parallel:/dev/lp0
device for Stylus-C86/Draft: parallel:/dev/lp0
device for Stylus-C86/gLabels: parallel:/dev/lp0
device for vPDF: cups-pdf:/

== Versions of important printing packages ==
ii cupsys 1.2.2-0ubuntu0.6.06 Common UNIX Printing System(tm) - server
ii foomatic-db 20060408-1ubuntu1 linuxprinting.org printer support - database
ii foomatic-db-engine 3.0.2-20060318-1ubuntu1 linuxprinting.org printer support - programs
ii foomatic-db-hpijs 1.5-20060318-1 linuxprinting.org printer support - database
ii foomatic-filters 3.0.2-20060318-2 linuxprinting.org printer support - filters
ii foomatic-filters-ppds 20060406-0ubuntu1 linuxprinting.org printer support - prebuilt
ii gs-common 0.3.9ubuntu1 Common files for different Ghostscript relea
ii gs-esp 8.15.2.dfsg.0ubuntu1-0ubuntu1 The Ghostscript PostScript interpreter - ESP
ii gutenprint 5.0.0-1 Gutenprint 5.0.0
ii hpijs 2.1.7+0.9.7-4ubuntu1 HP Linux Printing and Imaging - gs IJS drive
ii hplip 0.9.7-4ubuntu1 HP Linux Printing and Imaging System (HPLIP)
ii hplip-ppds 0.9.7-4ubuntu1 HP Linux Printing and Imaging - PPD files
ii libgnomeprint2.2-0 2.12.1-3ubuntu2 The GNOME 2.2 print architecture - runtime f

Created with printingbuginfo script v1.3 (https://wiki.ubuntu.com/PrintingBugInfoScript)
Tue, 30 Jan 2007 11:18:20 +0100

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Can you give the output of the following command:
$ lpoptions

Changed in cupsys:
assignee: nobody → pascal-devuyst
status: Unconfirmed → Needs Info
Revision history for this message
Nicholas Wastell (nickwastell) wrote :

As follows:

$ lpoptions
job-sheets=none,none printer-info=Stylus-C86 printer-is-accepting-jobs=1 printer-is-shared=1 printer-make-and-model='Epson Stylus C86 - CUPS+Gutenprint v5.0.0' printer-state=3 printer-state-change-time=1169988473 printer-state-reasons=none printer-type=8425484 Dithering=ColourFastCMYK PageSize=A4 Uniform=False PageRegion=A4 Encoding=RunLength Weaving=Off stcolor=False Resolution=None StpInkType=None OutputOrder=Reverse StpQuality=Standard

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Do you have the problem when printing from gedit too?

Perhaps the postscript output will tell more, can you provide foomatic-rip.ps and foomatic-rip.log as described here: https://wiki.ubuntu.com/DebuggingPrintingProblems under "IV. No or unexpected printing results".

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

With gEdit: yes, it appears that the text is reflowed for Letter (large bottom margin; small right margin). More difficult to detect with text output.

Re: wiki link debug instructions. After setting 'debug: 1' and restarting cupsys, I have no /tmp/foomatic* files. There are (what appears to be) copies of the ppd file in /tmp, one copy for each print job, but no other debug information or log files.

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Read the instructions carefully, you should edit the file /etc/foomatic/filter.conf

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Yes, as I said:

'After setting 'debug: 1' ...' (in /etc/foomatic/filter.conf)

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

Note that only the Samsung printer uses foomatic-rip and not the Epson (it uses a native CUPS driver). So for all tests using foomatic-rip use only the Samsung printer.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Thanks -- I don't feel so worried now ;-)

Note that the Samsung (and cups-pdf) output is correct: only the Epson shows the problem. Also, the problem is not evident on the Epson with Turboprint driver.

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Sorry my mistake, gutenprint indeed is a cups-raster driver.
A nice test would be to change the paper size to e.g. A5 and try to print something. Does it still default to Letter?
If so please attach your /etc/cups/ppd/Stylus-C86.ppd

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Okay, I have tried printing to A5 from Evince (A5 pdf) and gEdit (plain text), but with the printer loaded with A4 paper. (The printer is unable to report paper size back to the system.)

In each case, the output was centred on a Letter sized area (so, offset from the centre of A4), but the printed area was A5 sized. Thus the printed output appeared approximately centred on an A4 sheet.

Attached is the *original CUPS generated* ppd file. Note that there is some inconsistency in paper sizing:

DefaultPageSize and DefaultPageRegion are set to A4;
DefaultImageableArea and DefaultPaperDimension are set to Letter.

Changing the second two to A4 makes no difference to the printed output (including system reboot). All system settings are for European locale and A4 default (as far as I know).

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

> D [27/Jan/2007:15:58:36 +0100] [Job 137] PageSize = [ 612 792 ],
> HWResolution = [ 100 100 ]

The above line from your error_log indicates that a HWResolution of 100dpi is used but according to your PPD file this resolution is not supported by your printer.

Does changing the resolution give any difference?

Your PPD has some errors.
$ cupstestppd Stylus-C86.ppd-orig

Stylus-C86.ppd-orig: FAIL
      **FAIL** Bad Resolution choice None!
                REF: Page 84, section 5.9
      **FAIL** Bad Resolution choice 360x180sw!
                REF: Page 84, section 5.9
      **FAIL** Bad Resolution choice 360sw!
                REF: Page 84, section 5.9

According to the Adobe PPD Specification Option keywords of *Resolution should have this format: 600x300dpi or 600dpi when both x an y resolution are the same.

I have created a corrected PPD file that PASSes cupstestppd and attached it, please set up your printer queue with this PPD and try if this gives the correct paper size output.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

No change with the revised ppd file; no change with different printer output resolutions. I have no idea where that HWResolution setting is coming from!

I have attached the full cups error log for a complete print job (Job 235), with the revised ppd file and the first job after cupsys restart.

Test print was made from gEdit, plain text, one page, size A5. The default printer settings (in Ubuntu's printer manager) were for A5 paper and 360x180 dpi ('Draft'). The resolution setting has not transferred to the output -- the error log shows a final output resolution of 720x360 ('Normal' setting, I think). There is no possibility to change the print resolution from the gnome print dialog in gEdit, so I would expect it to use the default setting here. Maybe a dangerous assumption! ;-)

Thank you for your attention with this problem.

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Do you still have this issue with the LiveCD of Ubuntu 7.04 (Feisty)?
Feisty has cupsys-driver-gutenprint 5.0.0.99.1-0ubuntu2.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Yes, the problems seems to be fixed with Ubuntu 7.04.

Do you know of any plans to backport the forthcoming stable gutenprint to Dapper?

Thank you for your assistance -- it's good to see a continuing improvement in Linux capabilities.

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

Can you try the distribution-independent Gutenprint package from here:

http://openprinting.org/show_driver.cgi?driver=gutenprint

Follow the "How to install" link for instructions.

Uninstall cupsys-driver-gutenprint before installing the distribution-independent Gutenprint package. Use the command

sudo dpkg -p --force-dpends cupsys-driver-gutenprint

for that.

Please tell whether this works for you.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

I see that I have already tried v5.0.0.99-1, compiling from source, but I backed out to v5.0.0 -- I don't remember the reason for going back, so I'll try again.

Some observations with the LSB version:

- the .deb produced by converting the .rpm wants to install in /opt instead of /usr/share (Ubuntu default location).

- the installation instructions at OpenPrinting (your link) are not very clear.

Result with v5.0.0.99-1:
/var/log/cups/error_log is filling up with 'cupsdAuthorize: Local authentication certificate not found!', queued jobs have status 'Stopped: job-stopped'. Unable to use escputil (same reason?).

I'll have to go back to v5.0.0 for productivity reasons ;-). Let me know if you want some more tests, in another place if this is too far off the Launchpad topic.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Unable to 'dpkg -P gutenprint' (v5.0.0.-99) -- pre-removal script exits with error 1. Is it safe to force things?

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Sorry for the traffic.

gutenprint.prerm contains a reference to cups-config, which doesn't exist on my system.

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

'cupsdAuthorize: Local authentication certificate not found!' is not caused by the drivers being at another place than usual. This should be independent of thw Gutenprint package.

Can you check whether you have the /opt/gutenprint directory when the LSB package of Gutenprint is installed? Or better when you cannot print with this package please post the result of

ls -lR /opt/gutenprint

The reference to cups-config in gutenprint.prerm is no problem, as if there is no cups-config, the script will simply work without the output of cups-config.

Can you install the LSB package of Gutenprint and uninstall it with

sudo dpkg -P -D2 gutenprint

and post the output here.

Make also sure that you use the newest version of the Gutenprint package from OpenPrinting (gutenprint-5.0.0.99.1-3lsb3.1.i486.rpm).

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

You are saying

- the installation instructions at OpenPrinting (your link) are not very clear.

What was not clear? What should I add/change?

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

Yes, /opt/gutenprint exists. The listing you requested is attached.

I am using the v5.0.0.99-1, converting from .rpm to .deb with ubuntu's alien.

dpkg -P output follows:

:~$ sudo dpkg -P -D2 gutenprint
Password:
(Reading database ... 204449 files and directories currently installed.)
Removing gutenprint ...
D000002: fork/exec /var/lib/dpkg/info/gutenprint.prerm ( remove )
dpkg: error processing gutenprint (--purge):
 subprocess pre-removal script returned error exit status 1
D000002: fork/exec /var/lib/dpkg/info/gutenprint.postinst ( abort-remove )
 * Restarting Common Unix Printing System: cupsd [ ok ]
Errors were encountered while processing:
 gutenprint
:~$

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

Can you install the OpenPrinting of Gutenprint again (preferably the newest version) and then do

sudo /var/lib/dpkg/info/gutenprint.prerm remove

and post the screen output?

To clean up after that uninstall and install the Gutenprint package again.

Revision history for this message
Nicholas Wastell (nickwastell) wrote :

"Can you install the OpenPrinting of Gutenprint again (preferably the newest version)"

Do you mean the gutenprint package? I cannot reinstall -- the same errors appear because the old package is removed first.

'sudo /var/lib/dpkg/info/gutenprint.prerm remove' produces no screen output.

Apologies if this is meaningless, but if I do this:

:~$ sudo /var/lib/dpkg/info/gutenprint.prerm
/var/lib/dpkg/info/gutenprint.prerm: line 11: test: !=: unary operator expected
:~$

Is that error significant?

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Fixed in Feisty

Changed in gutenprint:
status: Needs Info → Fix Released
Changed in cupsys:
assignee: nobody → pascal-devuyst
status: Unconfirmed → Rejected
Revision history for this message
Nicholas Wastell (nickwastell) wrote :

But what about the LTS release?

Revision history for this message
AndreK (andre-k) wrote :

same problem exists in 9.04 beta. for LaserJet 5M
Printing always sends in "letter" format, disrespecting the printer driver setting that is clearly set to "A4"

can be solved by ; sudo dpkg-reconfigure libpaper1

but the real solution should be that default paper format should depend on the locale variable.
LC_PAPER="nb_NO.UTF-8" <- should mean A4.

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

Other bug subscribers

Remote bug watches

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