Bug 44664 - cups landscape woes with pdf: printer truncates Landscape orientation pages to Portrait dimensions
Summary: cups landscape woes with pdf: printer truncates Landscape orientation pages t...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: All Linux (All)
: highest major
Assignee: Caolán McNamara
URL:
Whiteboard: target:4.0.0
Keywords:
: 35132 38962 39289 41968 42777 42907 43506 43656 45340 47151 47804 48172 48394 52308 58884 (view as bug list)
Depends on:
Blocks: mab3.6
  Show dependency treegraph
 
Reported: 2012-01-11 01:18 UTC by sasha.libreoffice
Modified: 2013-12-04 15:44 UTC (History)
34 users (show)

See Also:
Crash report or crash signature:


Attachments
contents of my /etc/cups (12.19 KB, application/zip)
2012-01-11 01:30 UTC, sasha.libreoffice
Details
Switch to printer langauge Postscript level 2 as default (1.12 KB, patch)
2012-08-26 09:46 UTC, Jaroslav Krejci
Details
Switch to printer langauge Postscript level 2 as default (regenerated) (1.31 KB, patch)
2012-11-07 22:18 UTC, Lior Kaplan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sasha.libreoffice 2012-01-11 01:18:31 UTC
From Calc printer prints Landscape page orientation as Portrait
Steps to reproduce:
0. Close all instances of Libre office
1. Start Calc
2. Type something in first cell
3. do Format->Page orientation Landscape
4. Print this document
Result: document printed in wrong orientation

Note that page preview and printer dialog preview display correct results and export to PDF exports correctly

Produced on LibO 3.5.0 beta 1 on Fedora 64 bit
Comment 1 sasha.libreoffice 2012-01-11 01:30:52 UTC
Created attachment 55412 [details]
contents of my /etc/cups

On LibO 3.3.4 on Fedora 64 bit prints correctly
Comment 2 Clemmitt Sigler 2012-01-11 06:32:48 UTC
Hi all,

(In reply to comment #0)
> From Calc printer prints Landscape page orientation as Portrait

It is possible that this is the same issue as Bug 38962 (which affects me).

Please see Bug 38962 Comment 3 for IMHO the key note: The bug is triggered by Printer Language Type set to PDF instead of one of the PS options.  The problem seems to exist in 3.4.X and 3.5.X, which provide Printer Language Type=PDF, while it doesn't in 3.3.X, where PDF is not an option.  Also, it seems to be primarily related to Brother printers (both mine are that brand), although it is also reported to affect a Samsung printer.

HTH.

Clemmitt
Comment 3 Petr Mladek 2012-01-11 07:55:31 UTC
I am unable to reproduce this with the steps in the comment 0, LO-3.5.0-beta2 on SLED11-SP1-x86_64, HP LaserJet P2015dn. I tried both "Printer Language Types": PDF and Poscript Level 2.

So, it is probably related to some types of printers or other settings.
Comment 4 sasha.libreoffice 2012-01-12 21:14:37 UTC
Thanks for interesting in my problem.
Copy-paste workaround that solves my problem perfectly:
Goto File -> Printer Settings -> Properties -> Device and
change "Printer Language Type" from PDF to one of the Postscript options.
Comment 5 lanasth 2012-01-27 10:03:16 UTC
(In reply to comment #3)
> I am unable to reproduce this with the steps in the comment 0, LO-3.5.0-beta2
> on SLED11-SP1-x86_64, HP LaserJet P2015dn. I tried both "Printer Language
> Types": PDF and Poscript Level 2.
> 
> So, it is probably related to some types of printers or other settings.

I've got LO-3.5.0-beta2 on 3 Win764-bit machines, and have the same issues with ANY laser printer that's not also a copier (including any old HP workhorse laser).  Choose any other kind of printer (InkJet, pseudo-PDF, a business-class copy machine, etc.), and the problem is non-existent.  I can't find any such "Printer Language" option in Win and the problem is definitely LO (not OpenOffice). See Bug 44275.
Comment 6 Steve 2012-02-26 19:56:09 UTC
I can confirm this using the hpijs CUPS driver.

I can also confirm the workaround - however it has to be done each time LO is opened.
Comment 7 Steve 2012-02-26 19:59:55 UTC
My setup:

2 x EL6.2 desktops
LO 3.5.0
Printer: Fuji Xerox DocuCentre C2270
Driver: hpijs

Both print the content in portrait.

Setting File -> Printer Settings -> Properties -> Device and
change "Printer Language Type" from PDF to one of the Postscript options fixes the printout until LO is opened again. Once re-opened, the type returns to PDF and the printing error returns.
Comment 8 Steve 2012-02-27 01:26:31 UTC
Good call adding this to the most annoying bugs bug.

I would also like to point out that this issue does not solely happen within Calc. I have a Writer document that does exactly the same.
Comment 9 Caolán McNamara 2012-02-27 02:11:41 UTC
It's quite likely that this "truncation of landscape page under Linux" is a cups problem with pdf and landscape rotation, e.g. see https://bugzilla.redhat.com/show_bug.cgi?id=740496 and https://bugs.launchpad.net/ubuntu/+source/cups/+bug/47649

So, the relevant information is:
a) what Linux distribution this is happening on
b) and what versions of cups and ghostscript-cups are installed, e.g. output of rpm -q cups ghostscript-cups on fedora
Comment 10 sasha.libreoffice 2012-02-27 02:14:26 UTC
Fedora 15 Lovelock 64 bit
[s@t2 lib]$ rpm -q cups ghostscript-cups
cups-1.4.8-5.fc15.x86_64
ghostscript-cups-9.04-3.fc15.x86_64
Comment 11 Caolán McNamara 2012-02-27 02:15:28 UTC
*** Bug 38962 has been marked as a duplicate of this bug. ***
Comment 12 Steve 2012-02-27 02:16:32 UTC
# cat /etc/redhat-release
Scientific Linux release 6.2 (Carbon)

System #1:
# rpm -q cups ghostscript-cups
cups-1.4.2-44.el6.x86_64
package ghostscript-cups is not installed

System #2:
# rpm -q cups cups-ghostscript
cups-1.4.2-44.el6.i686
package cups-ghostscript is not installed

Both systems using LO 3.5.0
Comment 13 Caolán McNamara 2012-02-27 02:19:42 UTC
*** Bug 43656 has been marked as a duplicate of this bug. ***
Comment 14 Caolán McNamara 2012-02-27 02:20:23 UTC
*** Bug 42777 has been marked as a duplicate of this bug. ***
Comment 15 Caolán McNamara 2012-02-27 02:21:19 UTC
*** Bug 39289 has been marked as a duplicate of this bug. ***
Comment 16 Caolán McNamara 2012-02-27 02:45:59 UTC
"using the hpijs CUPS driver", for those using hpijs, can you try hpcups instead, i.e. follow https://bugzilla.redhat.com/show_bug.cgi?id=768811#c10 (fedora-specific howto)
Comment 17 lanasth 2012-02-27 05:05:28 UTC
(In reply to comment #16)

This bug is not restricted to Linux, nor to one type of driver.  See Bug 44275.
Comment 18 Dario 2012-02-27 08:32:06 UTC
I use Libreoffice 3.5 on PCLinuxOS (KDE) and confirm the same problem: Writer doesn't print landscape oriented pages. I have to change the Printer Language Type" from PDF to one of the Postscript options. But every time I close and open LO I have to repeat it. Very annoying!

cups-1.4.6-1pclos2011
ghostscript-cups is not found
Comment 19 Caolán McNamara 2012-02-27 12:44:10 UTC
re: "This bug is not restricted to Linux, nor to one type of driver" which is why your bug is not marked as a duplicate of this one. This one is for the collection of bugs suspected to be due to to something cups-side with landscape pdf pages so unix-specific. 

Ubuntu/Debian Linux derivatives are suspiciously absent from the list of affected Linux systems so far.
Comment 20 davepet 2012-02-28 15:47:57 UTC
I'm confirming both the problem & the temporary fix on PCLinuxOS 2011 (KDE) & LO 3.4.3

rpm -q cups ghostscript-cups
cups-1.4.6-1pclos2011
package ghostscript-cups is not installed
Comment 21 keellambert 2012-03-12 03:36:27 UTC
For new files LO always selects "Printer Language Type" as PDF.
The problem is also evident when I try to print two portait pages on a single
page both in writer and in calc.

On any existing file once the "Printer Language Type" has been changed it is
remembered.

For me the new PDF "Printer Language Type" is the problem.

my setup, 
Libreoffice 3.5, openSUSE12.1
Samsung SCX-4200, CLX-2160N printers

<2012Mar12><10:28><~/Updates/Tumbleweed_12.1>  rpm -q cups ghostscript-cups
cups-1.5.0-2.1.3.x86_64
package ghostscript-cups is not installed
<2012Mar12><10:54><~/Updates/Tumbleweed_12.1>
Comment 22 Steve 2012-03-12 06:26:23 UTC
Bumping the priority on this - as this is a basic functionality that should be fixed ASAP. Landscape printing is probably one of the cornerstones of an office package.
Comment 23 sasha.libreoffice 2012-03-17 01:05:35 UTC
*** Bug 35132 has been marked as a duplicate of this bug. ***
Comment 24 Steve 2012-04-07 09:04:14 UTC
Hi all,

Just short of a month since the last comment with no new details. Is there any news on this bug?
Comment 25 sasha.libreoffice 2012-04-09 01:20:21 UTC
reproducible in 3.5.2 on Fedora (tested from Writer)
Comment 26 sasha.libreoffice 2012-04-09 01:45:03 UTC
@ Steve
Sorry, but "Version" is most old reproducible version, for determine when bug appears. Not current version. If in current version bug not reproducible, it just closed to status WorksForMe.
Comment 27 Steve 2012-04-09 01:53:10 UTC
Ah, if thats the case then, I'll set it back to 3.5.0. I thought it was what was used to keep track of bugs against a certain version like some other projects.
Comment 28 sasha.libreoffice 2012-04-14 00:05:39 UTC
*** Bug 41968 has been marked as a duplicate of this bug. ***
Comment 29 Cor Nouws 2012-04-15 07:22:52 UTC
(In reply to comment #19)

> Ubuntu/Debian Linux derivatives are suspiciously absent from the list of
> affected Linux systems so far.

Ineed:  Just tested with 3.5.2 and master (2012-10-04) on Ubuntu 32 Bits;
Works fine here.
Comment 30 Cor Nouws 2012-04-15 14:04:17 UTC
*** Bug 45340 has been marked as a duplicate of this bug. ***
Comment 31 mab 2012-04-16 03:45:21 UTC
"Change "Printer Language Type" from PDF to one of the Postscript options fixes
the printout until LO is opened again. Once re-opened, the type returns to PDF
and the printing error returns."

Some have found that a change to 'Postscript Level 2' will stick...

(I did it via 'spadmin' (/opt/libreoffice3.4/program/spadmin here).)
Comment 32 sasha.libreoffice 2012-04-16 04:06:59 UTC
@ mab
Very much thanks for this workaround. It works.
Comment 33 mab 2012-04-16 05:16:31 UTC
(In reply to comment #32)

  Glad to hear that!

Which version of LO will avoid the problem?
Comment 34 sasha.libreoffice 2012-04-16 07:52:44 UTC
This workaround works for 3.5.2 on Fedora 64 bit
Comment 35 sasha.libreoffice 2012-04-20 06:01:40 UTC
*** Bug 42907 has been marked as a duplicate of this bug. ***
Comment 36 malv_star 2012-04-22 09:49:44 UTC
I can confirm that this bug is present as far back as LibreOffice 3.4.5 running on openSUSE 11.4 32-bit. Once again an RPM-based distro. As per comment 26, I'm setting the bug to the oldest version on which this issue is reproducible. Hoping to get a fix for this prior to the release of openSUSE 12.2 in July.
Comment 37 sasha.libreoffice 2012-04-27 08:58:51 UTC
*** Bug 43506 has been marked as a duplicate of this bug. ***
Comment 38 sasha.libreoffice 2012-05-31 03:47:35 UTC
*** Bug 47151 has been marked as a duplicate of this bug. ***
Comment 39 sasha.libreoffice 2012-06-15 02:39:43 UTC
*** Bug 48394 has been marked as a duplicate of this bug. ***
Comment 40 sasha.libreoffice 2012-06-18 05:27:24 UTC
*** Bug 47804 has been marked as a duplicate of this bug. ***
Comment 41 sasha.libreoffice 2012-06-28 02:13:16 UTC
*** Bug 48172 has been marked as a duplicate of this bug. ***
Comment 42 sasha.libreoffice 2012-08-16 06:56:25 UTC
*** Bug 52308 has been marked as a duplicate of this bug. ***
Comment 43 Jaroslav Krejci 2012-08-26 09:41:34 UTC
I can confirm too  - bug still valid in LO 3.5.x in Mageia 2 and LO 3.6.1 builded myself on Mageia 2. 
"PDF" language for the printer has another victim: printing envelope DL (Mageia bug No. 4521: https://bugs.mageia.org/show_bug.cgi?id=4521)

Solution:
I wrote small patch which switch as default langauge for printer Postscript level 2. Tested on LO 3.6.1 - works very well.
Comment 44 Jaroslav Krejci 2012-08-26 09:46:18 UTC
Created attachment 66131 [details]
Switch to printer langauge Postscript level 2 as default
Comment 45 Russ Fineman 2012-09-06 19:33:26 UTC
I can report this bug also is occuring on openSUSE12.2 GM, released two days ago. Using libreoffice 3.5.4. Work around does work, but real pain to have to change each time.

Thanks
Comment 46 Lou 2012-09-09 20:18:43 UTC
Bug is present in OpenSuSE 12.2, LO 3.5.4.7-1.1.2.x86_64.  The default should be changed to PostScript 2.
Comment 47 Jakob Unterwurzacher 2012-09-25 14:57:48 UTC
Regarding "Ubuntu/Debian Linux derivatives are suspiciously absent from the list of affected Linux systems so far.": This is on Ubuntu 12.04, LO 3.5.4.

Printing does not work AT ALL here with a networked PostScript printer (some big Xerox machine) and the language set to PDF. It works unreliably with PS. Often just nothing happens when you print. The job is not even queued.
Printing from every other application works perfectly. Printing with OO 3.2.0 used to work perfectly (on Ubuntu 10.04).
Comment 48 Igor Strelnikoff 2012-10-18 17:44:25 UTC
I have this bug stretches from OpenSUSE 11.3 with LibreOffice 3.4 in OpenSUSE 12.2 with LibreOffice 3.5 is present, too.
Comment 49 Lior Kaplan 2012-11-07 22:18:27 UTC
Created attachment 69672 [details]
Switch to printer langauge Postscript level 2 as default (regenerated)

I regenerated Jaroslav's patch and sent it for review at https://gerrit.libreoffice.org/1003
Comment 50 Michael Meeks 2012-11-09 10:53:06 UTC
In general, switching back to PS is a retrograde step and I'm pretty certain we don't want to do that - but I'll seek advice from our cups maintainers :-)
Michael Stahl did a nice write-up here:

http://lists.freedesktop.org/archives/libreoffice/2012-November/040835.html
Comment 51 Not Assigned 2012-11-29 14:46:08 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=59b98580bfd70205a9ebdb0ba67e74225d875b43

Resolves: fdo#44664 Provide a way to set the default print job format.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 52 sasha.libreoffice 2012-11-30 07:41:12 UTC
Very much thanks for fixing this bug
Comment 53 Not Assigned 2012-11-30 14:14:08 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=08597f2897e5ac752147c8f2c4a91bb557ed4580

Related: fdo#44664 spadmin support for forcing "postscript of driver level"



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 54 Caolán McNamara 2012-11-30 14:29:05 UTC
So...

cups recommends PDF as the standard print job format and I don't want to revert back to postscript as the standard print job format because there are fairly compelling features that using PDF enables.

That said, given the big pile of duplicate bugs here, there are clearly either a lot of buggy cups+pdf stacks out there or there's something about our PDF output that trips something up and using postscript is the only known workaround.

To that end...

a) In any version of LibreOffice in the print dialog or in "printer options" you can temporarily override the default print job format for that document for the current session. That won't "stick" permanently (it's not supposed to).
b) In spadmin it *should* have been possible to override the print job format permanently an individual printers as a workaround. That didn't work and is now fixed on master as 08597f2897e5ac752147c8f2c4a91bb557ed4580
b) In LibreOffice 4 under tools->options->print there is now an additional checkbox to disable using PDF as the default print job format for all printers as 59b98580bfd70205a9ebdb0ba67e74225d875b43

Working under the assumption that the problem is not in our PDF output, but instead is due to probably multiple different bugs in probably multiple pieces of the cups stack, this is the best I think we can do on our side.

See http://fedoraproject.org/wiki/How_to_debug_printing_problems#Finding_where_the_problem_lies for a useful guide to finding what component in the cups stack that might be causing your individual problems in order to track down the root causes.

If anyone has any evidence that there really is a fault in our PDF generation then please open a new bug for that.
Comment 55 Till Kamppeter 2012-11-30 17:46:38 UTC
The pdftopdf filter of cups-filters 1.0.25 (issued yesterday) has auto-rotation functionality added to fix this problem. See

https://bugs.linuxfoundation.org/show_bug.cgi?id=1080
Comment 56 Michael Meeks 2012-12-14 21:38:25 UTC
Thanks Till - so we don't need to start parsing the PPDs and black-listing known-broken printer drivers based on:

> If any of those attributes says the driver can handle
> "application/vnd.cups-pdf" or "application/vnd.cups-postscript" by
> running a program to do it (i.e. any filter other than "-"),

cf. mail on dev-list ;-) if so that's a relief. Thanks for fixing it.
Comment 57 Todd 2013-06-24 19:02:53 UTC
$ cat /etc/redhat-release
Scientific Linux release 6.4 (Carbon)

$ uname -r
2.6.32-358.11.1.el6.x86_64

$ rpm -qa cups
cups-1.4.2-50.el6_4.4.x86_64

$ rpm -qa libreoffice\*
libreoffice4.0-writer-4.0.4.2-2.x86_64


Problem still exists and is not resolved.  In every other program, landscape and portrait are respected.  Word Pro, thought Wine and CUPS, prints center positioned, landscape envelopes properly.

I appreciate you reopening this.

Many thanks,
-T
Comment 58 Joel Madero 2013-06-24 19:14:27 UTC
Moving to 3.6 MAB as 3.5 is EOL
Comment 59 Caolán McNamara 2013-06-25 09:56:47 UTC
a) In any version of LibreOffice in the print dialog or in "printer options" you can temporarily override the default print job format for that document for the current session. That won't "stick" permanently (it's not supposed to).
b) In spadmin it *should* have been possible to override the print job format permanently an individual printers as a workaround. That didn't work and is now fixed on master as 08597f2897e5ac752147c8f2c4a91bb557ed4580
b) In LibreOffice 4 under tools->options->print there is now an additional checkbox to disable using PDF as the default print job format for all printers as 59b98580bfd70205a9ebdb0ba67e74225d875b43

Working under the assumption that the problem is not in our PDF output, but instead is due to probably multiple different bugs in probably multiple pieces of the cups stack, this is the best I think we can do on our side.

See http://fedoraproject.org/wiki/How_to_debug_printing_problems#Finding_where_the_problem_lies for a useful guide to finding what component in the cups stack that might be causing your individual problems in order to track down the root causes.

If anyone has any evidence that there really is a fault in our PDF generation then please open a new bug for that.
Comment 60 ign_christian 2013-07-25 08:42:55 UTC
*** Bug 58884 has been marked as a duplicate of this bug. ***
Comment 61 Till Kamppeter 2013-12-04 15:44:24 UTC
One additional remark to my comment #55: The pdftopdf filter does the auto-rotation by setting the rotation fields of the pages in the PDF file. This rotation field is ignored by "pdftops -origpagesizes" (as pdftops is called by cups-filters). I have fixed this in Poppler. See bug #72312 and also BZR rev. 7131 in cups-filters upstream.