Custom PageSize has broken with lp/foo2zjs after upgrade to 8.10

Bug #338999 reported by Pavneet Arora
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CUPS
Invalid
Undecided
Unassigned
cups (Ubuntu)
Fix Released
Medium
Unassigned
foomatic-filters (Ubuntu)
Fix Released
Medium
Lars Karlitski

Bug Description

Binary package hint: cups

I have been using my HP LJ1020 reliably for many months under Ubuntu 8.04. A great part of what I print out are custom paper sizes: 3x5 index cards, envelopes, menus, etc. All have worked flawlessly. So for instance:

lp -o PageSize=Custom.4.125x9.5in -o landscape

would allow me to print on a standard No. 10 envelope by placing the envelope in the manual feed tray with the guides brought in, which means the paper is fed over the centreline of the paper path.

Recently I upgraded to 8.10 and now the images print on the left most side of the page, which means custom pages no longer work; there is only a single roller in the middle of the paper path.

I reported this to Rick Richardson, author of foo2zjs at this thread:

http://foo2zjs.rkkda.com/forum/read.php?7,1829

With his help, I believe that we have determined that cups is no longer handling the 'PageSize=Custom.NNxNNin' option properly and isn't passing it properly downstream. As a result, custom page size printing is no longer working properly.

This was working properly in 8.04 LTS.

Thanks

description: updated
Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

I also filed this on cups, and Michael Sweet suggests that is is a distro issue:

http://www.cups.org/str.php?L3119

since the version of cups being used on Fedora 10 and Ubuntu 8.10 are identical: 1.3.9.

Here is the relevant section of the message file:

[rick@kathleen ~]$ lpr -o PageSize=Custom.4.125x9.5in ~/proj/foo2zjs/testpage.ps

## Fedora 10. Works fine

[rick@kathleen ~]$ root grep foo2zjs /var/log/messages
Mar 6 14:13:20 kathleen foo2zjs-wrapper: foo2zjs-wrapper -P -z1 -L0 -r1200x600 -pCustom.297x684 -s7 -m1 -n1
Mar 6 14:13:24 kathleen foo2zjs-wrapper: gs -sPAPERSIZE=letter -g4950x5700 -r1200x600 -sDEVICE=pbmraw -dCOLORSCREEN -dMaxBitmap=500000000
Mar 6 14:13:24 kathleen foo2zjs-wrapper: foo2zjs -r1200x600 -g4950x5700 -p256 -m261 -n1 -d1 -s7 -z1 -u 2x100 -l 2x100 -L 0 -P

## Ubuntu 8.10. Note "-pCustom.297x684" on Fedora 10, but -p1 here
## This seems to be the source of the problem.

pavneet@darjiling:~/Software/foo2zjs$ grep foo2zjs /var/log/messages
Mar 6 15:34:36 darjiling foo2zjs-wrapper: foo2zjs-wrapper -P -z1 -L0 -r1200x600 -p1 -m1 -s7
Mar 6 15:34:36 darjiling foo2zjs-wrapper: gs -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=pbmraw -dCOLORSCREEN -dMaxBitmap=500000000
Mar 6 15:34:36 darjiling foo2zjs-wrapper: foo2zjs -r1200x600 -g10200x6600 -p1 -m1 -n1 -d1 -s7 -z1 -u 192x96 -l 192x96 -L 0 -P

In essence, the Custom PageSize isn't being passed on.

Based on a suggestion of Michael Sweet's to activate "cupsctl --debug-loggin" after posting on cups forums, I discovered the following in /var/log/cups/error_log:

D [07/Mar/2009:22:53:50 -0500] [Job 486] Found: %%BeginFeature: *CustomPageSize True
D [07/Mar/2009:22:53:50 -0500] [Job 486] Unknown option CustomPageSize=True foun
d in the job
D [07/Mar/2009:22:53:50 -0500] [Job 486] Found: %% FoomaticRIPOptionSetting: Pag
eSize=Custom
D [07/Mar/2009:22:53:50 -0500] [Job 486] Option: PageSize=Custom
D [07/Mar/2009:22:53:50 -0500] [Job 486] --> Invalid option setting found in job

Any suggestions?

Changed in cups:
assignee: nobody → larsuebernickel
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

On a completely updated Jaunty it works correctly. foo2zjs-wrapper is correctly called with "-pCustom.297x684" by foomatic-rip, same for a completely up-to-date Intrepid.

Please check whether your Intrepid installation is completely up-to-date. Please supply the output of "apt-cache policy foomatic-filters". It should be something like

till@till-desktop:~$ apt-cache policy foomatic-filtersfoomatic-filters:
  Installed: 4.0.0-0ubuntu3
  Candidate: 4.0.0-0ubuntu3
  Version table:
 *** 4.0.0-0ubuntu3 0
        500 http://de.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     4.0.0~bzr177-0ubuntu1 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
till@till-desktop:~$

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Dear Till,

Here is the output that was produced:

pavneet@darjiling:~$ apt-cache policy foomatic-filters
foomatic-filters:
  Installed: 4.0.0-0ubuntu3
  Candidate: 4.0.0-0ubuntu3
  Version table:
 *** 4.0.0-0ubuntu3 0
        500 http://ca.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     4.0.0~bzr177-0ubuntu1 0
        500 http://ca.archive.ubuntu.com intrepid/main Packages
pavneet@darjiling:~$

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

Can you then provide the error_log output of a complete job? From the two "[Job ???]" lines before the first "[Job ###]" line (### being the job number) until the very last "[Job ###]" line and all lines inbetween?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Dear Till,

Enclosed is the output for Job 498. Let me know if this captures all the details that you are looking for.

Cheers.

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

Can you also attach your PPD file, /etc/cups/ppd/HP-LaserJet-1020.ppd? Thanks.

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

And can you also attach the input file which you are using for your tests.

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Sorry my last comment should have read "... for Job 501."

Enclosed is the PPD file.

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Sample file enclosed.

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

...produced using TeXlive 2008, using custom document class used in production since 2007. Here is the beginning which identifies the geometry:

%% Class to produce cheques. Currently supports tear away personal cheques

\NeedsTeXFormat{LaTeX2e}[1996/06/01]
\ProvidesClass{personalcheque}[2007/06/27 Class to produce personal cheques]
\LoadClass[12pt]{article}
\RequirePackage[absolute]{textpos}
\RequirePackage{geometry}

\pagestyle{empty}

\geometry{paperwidth=6.25in,paperheight=2.75in}

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

Looks like the problem is that foomatic-rip does not handle custom page sizes embedded in a PostScript input stream, for the case that foomatic-rip gets fed with PostScript, as it happens for you due to the old Foomatic 3.x PPD file which you are using.

This needs to be fixed before the release of foomatic-filters 4.0.1.

Changed in foomatic-filters:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Can the PPD be updated to voercome the issue? Is there any other recourse to making this work?

Many thanks.

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

Is your system really completely up-to-date?

You should have:

till@till-desktop:~$ apt-cache policy cups
cups:
  Installed: 1.3.9-2ubuntu8
  Candidate: 1.3.9-2ubuntu8
  Version table:
 *** 1.3.9-2ubuntu8 0
        100 /var/lib/dpkg/status
     1.3.9-2ubuntu7 0
        500 http://de.archive.ubuntu.com intrepid-updates/main Packages
     1.3.9-2ubuntu6.1 0
        500 http://security.ubuntu.com intrepid-security/main Packages
     1.3.9-2 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
till@till-desktop:~$ apt-cache policy ghostscript
ghostscript:
  Installed: 8.63.dfsg.1-0ubuntu6.2
  Candidate: 8.63.dfsg.1-0ubuntu6.2
  Version table:
 *** 8.63.dfsg.1-0ubuntu6.2 0
        500 http://de.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     8.63.dfsg.1-0ubuntu6 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
till@till-desktop:~$

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

I have the following. My has 1.3.9-2ubuntu7 and not 1.3.9-2ubuntu8. Is that source of the problem? I don't believe that I did anything special; just did an upgrade.

Many thanks.

pavneet@darjiling:~$ apt-cache policy cups
cups:
  Installed: 1.3.9-2ubuntu7
  Candidate: 1.3.9-2ubuntu7
  Version table:
 *** 1.3.9-2ubuntu7 0
        500 http://ca.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     1.3.9-2ubuntu6.1 0
        500 http://security.ubuntu.com intrepid-security/main Packages
     1.3.9-2 0
        500 http://ca.archive.ubuntu.com intrepid/main Packages
pavneet@darjiling:~$ apt-cache policy ghostscript
ghostscript:
  Installed: 8.63.dfsg.1-0ubuntu6.2
  Candidate: 8.63.dfsg.1-0ubuntu6.2
  Version table:
 *** 8.63.dfsg.1-0ubuntu6.2 0
        500 http://ca.archive.ubuntu.com intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     8.63.dfsg.1-0ubuntu6 0
        500 http://ca.archive.ubuntu.com intrepid/main Packages
pavneet@darjiling:~$

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

Does it work now, with the updated CUPS?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Sorry, I meant that I just did an standard upgrade from 8.04LTS to 8.10. I don't show 1.3.9-2ubuntu8 under Synaptic at all. How do I upgrade to that?

Thanks.

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

1.3.9-2ubuntu7 is good enough, it is not the cause of the pronblem.

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

No it still isn't working. I wish it were ;).

Revision history for this message
Lars Karlitski (larsu) wrote :

Pavneet,

the problem is the order of options given to foomatic-rip. You can see it in this line of the log:

D [08/Mar/2009:20:00:19 -0400] [Job 501] argv[5]="PageSize=Custom.2.75x6.25in landscape media=Letter finishings=3 number-up=1 job-uuid=urn:uuid:ac90edd7-8cd0-303a-79fd-cfd201e2af9a"

First, the PageSize is set and after that the media option, which effectively overwrites the PageSize option (which is the correct behaviour). I have no idea *why* these options are in the wrong order. If I print the attached PDF with the attached PPD file and your lp command line, I get the correct ordering (first "media", then the options supplied on the command line, "PageSize" and "landscape"). A quick fix could be to explicitly give all of these options to lp in the correct order:

lp -o media=Letter -o PageSize=CustomXXX -o landscape

This might stop CUPS from inserting media=Letter again.

But the question of where these options come from remains: Do you have a ~/.lpoptions, ~/.cups/loptions, or /etc/cups/lpoptions?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

I will give this a try Lars. Thanks for the insight. At least the behaviour makes sense given what foomatic-filter is receiving as input. I look at all the config files.

Cheers.

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

Pavneet Arora, what about your ~/.lpoptions, ~/.cups/loptions, or /etc/cups/lpoptions files?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Sorry Till and Lars,

I have been travelling for the past few weeks and haven't had a chance to test at the workstation. Here is the answer to your question:

pavneet@darjiling:~$ more ~/.lpoptions ~/.cups/loptions /etc/cups/lpoptions files
/home/pavneet/.lpoptions: No such file or directory
/home/pavneet/.cups/loptions: No such file or directory
/etc/cups/lpoptions: No such file or directory
files: No such file or directory
pavneet@darjiling:~$ lpoptions
media=Letter finishings=3 copies=1 job-hold-until=no-hold job-priority=50 number-up=1 auth-info-required=none job-sheets=none,none printer-info='Hewlett-Packard HP LaserJet 1020' printer-is-accepting-jobs=1 printer-is-shared=1 printer-location=darjiling printer-make-and-model='HP LaserJet 1020 Foomatic/foo2zjs (recommended)' printer-state=3 printer-state-change-time=1238402260 printer-state-reasons=none printer-type=167940

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

I tried the explicit method as well:

pavneet@darjiling:~$ lp -o media=letter -o PageSize=Custom.2.75x6.25in -o landscape knuth.pdf
request id is HP-LaserJet-1020-532 (1 file(s))

...to no avail. The page emitted now is blank; previously one would get a shrunken image of the output (if you require I can scan the emitted page as well).

I am enclosing the output of the job (532).

Thank you.

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

Can you attach your /etc/cups/printers.conf?

If your /etc/cups/printers.conf does somewhere contain a line with "Letter" or "letter" in it, delete the line and restart CUPS ("sudo /etc/init.d/cups restart"). Does this solve your problem?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Enclosed. Doesn't seem to have any line with "[l|L]etter".

Also, just another data point: I had a chance to test this anomaly on another system that was also upgraded from 8.04 to 8.10 and has a LaserJet 1020 attached to it, and it has identical behaviour so I don't think it is specific to this particular workstation.

affects: foomatic-filters (Ubuntu) → cups (Ubuntu)
Revision history for this message
Lars Karlitski (larsu) wrote :

Pavneet, I just tried the explicit method (prepending media=letter) again on 8.10 and got an error in foo2zjs. This is a bug which has already been fixed in Jaunty, we will try to backport it.

As for the real cause of this problem: I have filed a CUPS bug here:

  http://cups.org/str.php?L3148+P0+S-2+C0+I0+E0+M20+Q

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

See upstream bug report for CUPS, order is not defined for the filter command line generated by CUPS. Filters have to give priority to (printer-specific) PPD options over (generic) CUPS options.

affects: cups (Ubuntu) → foomatic-filters (Ubuntu)
Changed in foomatic-filters (Ubuntu):
status: Triaged → In Progress
Changed in cups:
status: New → Invalid
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fixed upstream in foomatic-filters, rev 209 in the head branch and rev 204 in the 4.0.x branch.

Changed in foomatic-filters (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package foomatic-filters - 4.0.0-0ubuntu9

---------------
foomatic-filters (4.0.0-0ubuntu9) jaunty; urgency=low

  * debian/patches/23_prioritize-ppd-options-over-cups-options-on-command-line-fix-custom-options.patch:
    If there are printing system options (like "media" of CUPS) and PPD
    options (like "PageSize") on the command line and they do the same thing
    (like choosing the paper size) let the setting of the PPD option always
    have priority, as this is expected for a CUPS filter (see CUPS STR #3148).
    This is done by treating the printing system options before the PPD
    options (LP: #338999).
    Custom page sizes were not accepted if one of the three parameters
    "WidthOffset", "HeightOffset", or "Orientation" of the "PageSize" option
    in the PPD file did not allow 0 as value.
    Made error messages for the parameters of custom options more readable.

 -- Till Kamppeter <email address hidden> Tue, 31 Mar 2009 00:19:49 +0200

Changed in foomatic-filters:
status: Fix Committed → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Pavneet, if you have still problems, please replace your /usr/lib/cups/filter/pstopdf file by the attached one and make sure the permissions of the new file are correct ("chmod 755 /usr/lib/cups/filter/pstopdf"). Does this solve your problem?

Changed in cups (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Pavneet Arora (usonianhorizon) wrote : Re: [Bug 338999] Re: Custom PageSize has broken with lp/foo2zjs after upgrade to 8.10

Dear Till,

Yes I am still having problems. The image is centred and located
properly at the leading edge of the media. It is just that it is scaled
down to a tiny size. Size to fit doesn't affect it, and in any case I
don't want sizing to happen since the LaTeX position commands rely on
precise positioning of fields on the forms.

I'll give your suggestion a try and report back.

Thanks.

Till Kamppeter wrote:
> Pavneet, if you have still problems, please replace your
> /usr/lib/cups/filter/pstopdf file by the attached one and make sure the
> permissions of the new file are correct ("chmod 755
> /usr/lib/cups/filter/pstopdf"). Does this solve your problem?
>
>
> ** Attachment added: "pstopdf with support for custom page sizes"
> http://launchpadlibrarian.net/25559768/pstopdf
>
> ** Also affects: cups (Ubuntu)
> Importance: Undecided
> Status: New
>
> ** Changed in: cups (Ubuntu)
> Importance: Undecided => Medium
>
> ** Changed in: cups (Ubuntu)
> Status: New => Incomplete
>

--
-----
- Pavneet Arora

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

You have really done your last test with

lp -o PageSize=Custom.4.125x9.5in -o landscape knuth.pdf

and not with

lp -o PageSize=Custom.2.75x6.25in -o landscape knuth.pdf

The latter command line did appear in this thread later. The specified paper size is definitely too small for the example document. The former command line prints correctly for me.

Note that the pstopdf replacement is only for PostScript input files. If the input file is already PDF it has no influence.

Make also sure that "Scale to fit" is not set by default (system-config-printer: Right-click on printer -> Properties -> Job Options).

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

I must have typed the incorrect command for that particular attempt. This command is for a No. Envelope which also uses the custom page size. I am enclosing a new log and scan of the resulting output here for review. No change in behaviour at my end (the scaling is the remaining issue; the image is being positioned correctly on the media).

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Printed output attached.

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Approximate actual printed size of image is 2.625" W x 1.25" H (landscape). This is approximately 6.25cm x 2.75cm. Note the similarity to the desired size, which is is 6.25in W x 2.75in H (landscape). I wonder if the units aren't being passed through.

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

I do not see anything wrong in the logs and if I try to print it comes out correctly, independent whether I set up the queue with HP's driver or with foo2zjs. I am using Jaunty. Can you test on a Jaunty machine or with a Jaunty live CD?

Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

SUCCESS! I upgraded to Jaunty overnight and this morning things are working at first glance. I will upgrade the rest of the machines and do more thorough testing to ensure that I haven't missed anything.

Thanks so much to everyone for getting this fixed.

With warm regards.

Changed in cups (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Pavneet Arora (usonianhorizon) wrote :

Well, I am back with similar problems. I have just installed Karmic on a brand new machine. I am suffering through the usual assortment of USB printer issues where jobs are queued but don't get beyond processing. I have tried both hplip and foo2zjs. Well, I managed to get Test Pages printing now, but only for letter size jobs. Running lp with the -o PageSize=Custom... ends up with a foomatic-rip failed message in the Printer Configuration dialogue.

Any help would be really appreciated. I am dependent on custom page sizes for most of my printing needs.

Many thanks.

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.