Bug 447987 - Landscape print jobs from OS X clients have shifted margins
Landscape print jobs from OS X clients have shifted margins
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cups (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Tim Waugh
Depends On: 527429
  Show dependency treegraph
Reported: 2008-05-22 15:16 EDT by Michael Torrie
Modified: 2010-10-22 21:18 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-03-30 04:15:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
PDF landscape page, printed from MS Word on OS X 10.5 (10.78 KB, application/pdf)
2008-05-22 15:18 EDT, Michael Torrie
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 2850 None None None Never
CUPS Bugs and Features 2881 None None None Never

  None (edit)
Description Michael Torrie 2008-05-22 15:16:25 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20080416 Galeon/2.0.4 Firefox/

Description of problem:
Printing a landscape document from an OS X 10.4 or 10.5 client to a linux cups server results in the document being printing with shifted margins, shifting the page down and to the right, and cuts off the edges.  This happens with any postscript printer set up in our cups server.

I will attach a pdf document that can be used to reproduce this problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Use any OS X app, like MS Word and print a landscape page, or make a pdf
2. If you made a pdf, take it to the RHEL5 box and print it using: "lp -o orientation-requested=4 filename.pdf" as this simulates how Apple's Cups system sends the document

Actual Results:
Document prints, but margins are shifted.

Expected Results:
document should have printed in landscape correctly, but without shifting the margins.

Additional info:
Apple claims this is not their bug.  They say it is a problem in the PDF filter system that RedHat EL 5 ships with cups.  

In debugging this problem, I compiled from source the latest version of poppler pdf library and utilities, creating a custom /usr/local/bin/pdftops converter.  Then I compiled the "pdftops" cups filter from the latest svn version of cups to try.  With this combination the margins are correct but the landscape pages don't get rotated, so everything is cut off the right side.  So there still is a problem.  Apple claims that problem is in the RedHat EL 5 cups distribution still.
Comment 1 Michael Torrie 2008-05-22 15:18:15 EDT
Created attachment 306414 [details]
PDF landscape page, printed from MS Word on OS X 10.5

To use this pdf, on a RedHat EL 5 machine with cups set up to print to a
postscript printer, run:

lp -o orientation-requested=4 test.pdf

The page will print with the shifted margins.
Comment 2 Tim Waugh 2008-06-04 07:37:03 EDT
Also occurs with Fedora 9 as the print server.
Comment 3 Michael Torrie 2008-06-04 14:03:44 EDT
Just as another data point, I rigged up Adobe Reader to be a PDF filter for
cups.  The output for that is the same as poppler and what you describe in your
cups bug report.  Definitely appears to be a cups bug.
Comment 4 Michael Torrie 2008-06-04 14:45:16 EDT
Upgrading to EL 5.2 did not change it.  With stock pdftops filter I get:

|            |
|            |
|    abcdefgh|

Instead of 

|            |
|  abcdefgh  |
|            |
Comment 5 Tim Waugh 2008-07-15 06:01:59 EDT
CUPS revision 7726 is meant to fix this.
Comment 6 Michael Torrie 2008-07-15 12:06:19 EDT
Will wee see this fix rolled into an update rpm for RedHat EL 5?  In the
meantime I'll roll my own pdftops filter from the cups 1.3 branch where this is
Comment 7 Michael Torrie 2008-07-15 13:02:36 EDT
Actually the fix in revision 7726 does *not* fix the problem.  In fact, rather
than getting the output I mentioned in comment #4, I now get exactly the output
that you mention in your cups bug report.  The output has correct margins, but
is not rotated.  In fact the note on the cups bug report now says that the
output from cups-1.3 pdftops filter is now essentially the same as the output
from the cups 1.4 pdftops filter, which still has this annoying problem.  I will
attempt to comment and re-open the cups bug.
Comment 10 Tim Waugh 2009-06-01 10:32:02 EDT
A fix for this has been checked in upstream now.
Comment 11 Michael Torrie 2009-06-17 15:27:53 EDT
I changed the mime.convs file in /etc/cups as per the patch mentioned in str 2881 and compiled pdftops from the latest cups-1.3 svn sources and now landscape printing works for all my mac users.  I do have one Mac-originated PDF (a sheet with chart from MS Excel) that doesn't print correctly (nothing to do with landscape though) with the new svn pdftops filter.  I can supply this pdf if needed--probably need to open a new cups bug for this.

Except for this one problem that I encountered, the landscape problem appears solved.  Will you be integrating this fix into the RH EL 5 stock cups package?
Comment 12 Tim Waugh 2009-07-03 06:41:03 EDT
The patch provided upstream applies to the re-written pdftops filter introduced in 1.3.10.  I'm not sure we'd want to switch to that in Red Hat Enterprise Linux 5 at this stage, so it would mean finding a way to do the same thing in the "original" (1.3.7, Xpdf-based) pdftops filter.
Comment 15 Tim Waugh 2009-10-26 07:46:12 EDT
On the other hand, the re-written pdftops filter seems to behaving well in Fedora, and switching to it would be other advantages as well.
Comment 18 Chris Ward 2010-02-11 05:04:46 EST
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~

RHEL 5.5 Beta has been released! There should be a fix present in this 
release that addresses your request. Please test and report back results 
here, by March 3rd 2010 (2010-03-03) or sooner.

Upon successful verification of this request, post your results and update 
the Verified field in Bugzilla with the appropriate value.

If you encounter any issues while testing, please describe them and set 
this bug into NEED_INFO. If you encounter new defects or have additional 
patch(es) to request for inclusion, please clone this bug per each request
and escalate through your support representative.
Comment 19 Michael Torrie 2010-02-11 11:36:44 EST
The RHEL 5.5 beta cups rpms depend on poppler-utils, which is not in any of the beta channels.  Is this an oversight?  In any event, I installed the 1.3.7-16.el5 rpms from the beta channel on rhn using the poppler-utils that yum found in the normal, 5.4 channel.  Is 1.3.7-16.el5 the version in 5.5 beta?

There was absolutely no change.  The bug is still present, at least in the configuration I just mentioned (no new poppler-util).  The margins on the left and top were correct, but the result was not rotated.
Comment 20 Michael Torrie 2010-02-11 12:54:06 EST
Not sure at all that I got the latest beta cups packages.  What version are the latest beta packages?

The 1.3.7-16.el5 ones didn't work for me at all.  cupsd crashed about once an hour.  Rolled back to latest stable cups in the normal RHEL 5.4 channel.
Comment 21 Tim Waugh 2010-02-12 12:32:46 EST
Thanks for testing it out.  Yes, cups-1.3.7-16.el5 is the latest version.

First about cupsd crashing: I would very much appreciate it if you could try to obtain a stack trace from cupsd at the point it crashes.  Here's how:

1. Install the cups-debuginfo-1.3.7-16.el5 package, as well as gdb
2. Find the process ID of cupsd using 'ps aux'
3. As root, gdb /usr/sbin/cupsd 5302  (or whatever PID it is)
4. At the '(gdb)' prompt, enter 'continue'
5. When/if cupsd crashes, enter 'bt' and copy the output here.  The output of 'info locals' would also be useful.

Secondly, about the original problem: I have taken another look at the patch we've used and I can see a missing part.  The mime.convs file should have had this line:

application/pdf   application/postscript   33   pdftops

change to this:

application/pdf   application/vnd.cups-postscript   66   pdftops

because the patched pdftops filter runs pstops itself.

I will re-test a package with this change added.
Comment 22 Michael Torrie 2010-02-12 12:51:19 EST
Thank you for your work, Tim.

On my test machine I made the change to mime.convs and indeed landscape printing appears to be working!  Good news indeed.

As for debugging my crash, I cannot find a cups-debuginfo package in the beta channel on rhn's web page.  Is there another place I need to look?  I'll be happy to get you a trace as soon as I can find this.
Comment 33 errata-xmlrpc 2010-03-30 04:15:07 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.