Bug 154975 - All printing is in landscape format
Summary: All printing is in landscape format
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.5.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/portrai...
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Print
  Show dependency treegraph
 
Reported: 2023-04-23 22:35 UTC by Lee
Modified: 2024-09-03 20:28 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
I think this is the ppd requested (121.58 KB, text/plain)
2024-06-13 20:32 UTC, Lee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee 2023-04-23 22:35:32 UTC
Description:
I'm in the US so a page is 8.5 inches by 11 inches ie. letter size orientation PORTRAIT

Whether it is an existing Writer document or a simple document of a few lines, it looks portrait oriented but when printed to a physical printer, it comes out in landscape orientation.  Also a simple calc spreadsheet does the same thing.
This was first noticed going from XUbuntu 22.04 to 23.04.  I now find that even if such printing is done on the previous XUbuntu 22.04 system, it depends upon the version of LibreOffice. Through 7.4.6.2 all prints as expected.  Beginning with LO 7.5.0.0 (alpha) and a few releases through 7.6.0.0 - this situation is happening.

Steps to Reproduce:
1.Create a one line document or a one line few cell spread sheet
2.print in 'normal' portrait (8.5x11) format
3.

Actual Results:
Printed page is twisted left one quarter turn (ie landscape)

Expected Results:
A printed page that looks like the preview


Reproducible: Always


User Profile Reset: No

Additional Info:
This is happening on two systems that clearly do not have the same profile
Comment 1 Stéphane Guillou (stragu) 2023-04-24 14:01:03 UTC
I could not reproduce on Ubuntu 20.04 with GNOME 3.36.8 and:

Version: 7.5.3.1 (X86_64) / LibreOffice Community
Build ID: d29ee673721b12c92b3de9b9663473211414f0db
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

What I did:
1. New document, write some text
2. Format > Page Style > Page > Format: Letter
3. File > Print > Print to File, with Orientation Portrait or Automatic

Resulting PDF is in portrait mode, as expected.

Lee, please provide more information:
- Details copied from Help > About LibreOffice (as issue can be linked to locale)
- Printer model

Please also check that you've got the latest printer drivers.
Comment 2 Lee 2023-04-24 15:26:30 UTC
1. If printed as a PDF, all is well  portrait is portrait.  It's when selecting a real printer that the problem is observed.

2. This is happening on every version I've tried since the 7.5.0.0 (alpha).  The lastest version I have is something like 7.6.0.

3. This is happening on my XUbuntu 22.04 and on my XUbuntu 23.04.

4. Print drivers: 22.04 was probably set sometime last summer.  The other system (23.04) has got to be less than a week old since XUbuntu 23.04 is the April 2023 release of Ubuntu.  Both systems produce the same result.

5. The printers (there are two of them) are Canon Pixma iX6820.  The iX6820 is usually used for routine 8-1/2 x 11 printing.  It is capable of printing paper up to 13 inches wide and 22 inches long. I sometimes do print on tabloid (11x17) paper.
Comment 3 Stéphane Guillou (stragu) 2023-05-30 22:40:19 UTC
Could you please also test with a new profile or in Safe Mode to see if the issue persists? (Help > Restard in safe mode)
Comment 4 Lee 2023-05-31 02:29:55 UTC
(In reply to Stéphane Guillou (stragu) from comment #3)
> Could you please also test with a new profile or in Safe Mode to see if the
> issue persists? (Help > Restard in safe mode)

In short - no change, problem persists as of 7.5

In response to your request, my test efforts were with version 7.5.0.0.alph1, which is the first [oldest] version to introduce this problem.  Prior to testing, I set aside everything in ~.config/libreoffice/4 by renaming it.  I noticed that 7.5.0.0.alph1 was using ~/user instead.  I also renamed ~/user.  With this done, libreoffice was started with a fresh profile. The problem was no different.
Comment 5 Lee 2023-05-31 02:40:10 UTC
In my latest test as per the request of comment 3 - The physical page was printed portrait on a sheet of 8.5 x 11 paper HOWEVER, In order to get this correctly orientated page the paper was inserted into the printer sideways, that is, the paper was inserted so that it is wider than it is long (11 inches wide and 8.5 inches long).  The Canon iX6820 is capable of handling tabloid size paper.
Comment 6 Lee 2023-05-31 02:57:07 UTC
My printer is able to handle paper up to about 13 inches across. If I select tabloid page side (11x17), the page prints correctly.  I wondered if this was because the printer cannot print 17 inches across a page.  I also tried a legal size page - failed on that one even though 14 inches is too wide for my printer.  I have no idea why tabloid portrait would print correctly but both legal and letter sizes do not.
Comment 7 libreoffice 2024-01-02 22:50:41 UTC
I see this as well.
See 
  https://ask.libreoffice.org/t/portrait-prints-in-landscape-on-epson-3880/99616/2
Comment 8 Lee 2024-01-03 01:30:37 UTC
I see this evening someone has made a comment elsewhere they too have the problem.  
https://ask.libreoffice.org/t/portrait-prints-in-landscape-on-epson-3880/99616

My printers are Canon iX6820s.  This other person apparently has an Epson 3880.  This suggests the problem is not specific to a brand of printers.

Reviewing the specs of an Epson 3880 says it can handle 17x22 paper - approximately what a Canon iX6820 can also do.

This suggests the bug can only be observed using standard office paper on printers capable of handling tabloid size paper.

If I do print to tabloid size paper, it is done correctly.
Comment 9 libreoffice 2024-01-03 02:10:38 UTC
On my Epson 3880, 11x14 still prints as landscape, but 11x17 (tabloid) prints correctly.
Comment 10 Lee 2024-01-03 03:07:14 UTC
(In reply to libreoffice from comment #9)
> On my Epson 3880, 11x14 still prints as landscape, but 11x17 (tabloid)
> prints correctly.

Exactly the same as observed using Canon iX6820.  tabloid prints correctly however all smaller sizes are incorrect, including letter, legal and quarter sheets (4.25 x 5.5).
Comment 11 Lee 2024-01-03 03:08:31 UTC
Now that a second person has reported they too have the problem, I have changed status from unconfirmed to new.
Comment 12 Ismo 2024-04-03 17:48:57 UTC
I have the same problem with LibreOffice 7.6.5.2 on Kubuntu 23.10 with Epson Stylus Pro 3880 printer with CUPS and Gutenprint v5.3.4 driver. A portrait page on A4 paper prints out as landscape.
Comment 13 Lee 2024-05-08 01:07:03 UTC Comment hidden (obsolete)
Comment 14 Stéphane Guillou (stragu) 2024-05-08 07:06:55 UTC Comment hidden (obsolete)
Comment 15 Xisco Faulí 2024-05-09 11:30:22 UTC Comment hidden (obsolete)
Comment 16 libreoffice 2024-05-09 16:34:20 UTC
FWIW, I'm pretty sure it's specific to LibreOffice.  I have always successfully printed things with this bug by exporting to PDF and then using xpdf to print.
Thunderbird also prints correctly, as does Firefox.
All of them are going through CUPS.  

My wife prints from 7.3.7.2 with no problems.
Comment 17 Lee 2024-05-09 22:12:52 UTC
My comment #13 is incorrect.  Somehow I got my versions crossed.  I have again verified that the problem begins with 7.5.0.0 Alpha1.  

Comment #19 asks me to try some other application - No other application is exhibiting this twist of the page.  I just printed my firefox home page correctly minutes after again verifying that 7.5.0.0 Alpha1 unexpectedly prints 'twisted' ie. sideways.
Comment 18 Stéphane Guillou (stragu) 2024-05-10 00:09:43 UTC
Caolán, I see bug 151107 and associated commits.
Wondering if you have an idea or some hints for Lee and dreamchaser to find out more?
Comment 19 Lee 2024-05-10 02:21:21 UTC
Does this bibisection help find the bug?
I was using repository linux-64-7.5
 fd0996ef355d3b2a3e87be9390acdee24c2b2e2c is the first bad commit
commit fd0996ef355d3b2a3e87be9390acdee24c2b2e2c
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Sep 22 19:45:04 2022 +0200

    source 6005aeca4416eb0d583fd12ab837afa91d9d18ec
    
    source 6005aeca4416eb0d583fd12ab837afa91d9d18ec

 instdir/program/libvcllo.so | Bin 19250264 -> 19250360 bytes
 instdir/program/setuprc     |   2 +-
 instdir/program/versionrc   |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
Comment 20 Lee 2024-05-10 02:27:00 UTC
The reference in comment 17 to comment 19 should have been to comment 15
Comment 21 Stéphane Guillou (stragu) 2024-05-10 03:06:12 UTC
(In reply to Lee from comment #19)
> Does this bibisection help find the bug?
> I was using repository linux-64-7.5
This is great, thank you for bibisecting it!
The result matches what I suggested in comment 18, the issue started at:

	commit 6005aeca4416eb0d583fd12ab837afa91d9d18ec
	author	Caolán McNamara 	Wed Sep 21 22:22:38 2022 +0200
	committer	Caolán McNamara 	Thu Sep 22 19:40:02 2022 +0200
	tdf#151107 swap job orientation if paper matching swapped width/height
	if we eventually are forced to pick a final paper size which has the
	orthogonal orientation than that requested, then swap the orientation of
	the jobdata too
	and re-init the orientation to defaults in Printer::SetPaperSizeUser
	when we set a new user paper size rather than keeping the orig
	Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140358

Caolán, what do you think?
Comment 22 MasterCATZ 2024-06-11 10:08:04 UTC
and now I am the opposite nothing is printing in Landscape since going Ubuntu 22.04 to 24.04 LTS 

https://ask.libreoffice.org/t/libre-writer-not-printing-to-thermal-printer-in-correct-orientation/106763/9

exporting to PDF looks ok and printing  the PDF from "Document Viewer 46" works
Comment 23 Caolán McNamara 2024-06-13 19:06:40 UTC
What we probably need is to get the ppd file for that printer to see what is going on there, perhaps it is some rounding error which leads us to believe that it doesn't actually support the paper size that it tries to tell us it has.

Unfortunately getting the PPD that's used is not trivial to describe for all platforms etc. It is possible to start libreoffice from the console with SAL_CUPS_PPD_RETAIN_TMP set and then it saves the file to /tmp but doesn't tell you the name :-) ( I'll change that for the future with https://gerrit.libreoffice.org/c/core/+/168828 )

So you can try:

$ export SAL_CUPS_PPD_RETAIN_TMP=1
$ soffice --writer

and launch the print dialog, and after launching the dialog a file something like

/tmp/a06476672554a

should exist which will be text and start with something like

*PPD-Adobe: "4.3" and attach that here
Comment 24 Lee 2024-06-13 20:32:17 UTC
Created attachment 194710 [details]
I think this is the ppd requested

This is that system file
Comment 25 Lee 2024-06-13 20:44:55 UTC
The results in /tmp was not exactly as describled.  My part of /tmp was as follows:

lrwxrwxrwx 1 woola woola   21 Jun 13 15:16 666b538f75a8d -> /etc/cups/ppd/BS2.ppd
drwxr-xr-x 2 woola woola 4096 Jun 13 15:14 hsperfdata_woola
drwx------ 2 woola woola 4096 Jun 13 15:16 lu7694fde45.tmp
srwxrwxr-x 1 woola woola    0 Jun 13 15:14 OSL_PIPE_1006_SingleOfficeIPC_5a347cf2f4562e25470ed1dde7bbcf5
drwx------ 2 woola woola 4096 Jun 13 14:53 ssh-XXXXXXiv56pr
-rw-rw-r-- 1 woola woola    0 Jun 13 15:07 UpdateLock-FDC34C9F024745EB

Most curious is the symbolic link.  That file begins with the line
*PPD-Adobe: "4.3" 

Further into that file are some lines that contain ix6820.  My large format printer is a Canon Pixma ix6820.

I reset the bug status to NEW.
Comment 26 Caolán McNamara 2024-08-11 15:29:50 UTC
I can't seem to reproduce this with the ppd (but without the printer), but I was able to reproduce bug #154959 which is somewhat similar.

I wonder if https://bugs.documentfoundation.org/show_bug.cgi?id=154959#c22 solves this issue too, that change is merged to current trunk so should be testable in a current daily (as per the usual howto in the above link)
Comment 27 Lee 2024-08-11 21:34:29 UTC
The problem still exists in 
25.2.0.0.alpha0+(X86_64)/LibrreOffice Community
https://gerrit.libreoffice.org/gitweb?p=core.git;a=log;h=2fec61240fed71923e5e2172e8536438df2a2432

This bug has been confirmed by others.  I've set status to unconfirmed only because of the wording at the right as I type this response:
 
Note to Bug Reporter:
This bug is (most likely) in NEEDINFO status because someone has asked for information or data. After you've satisfied the request as best as you can, please leave a comment and change the status back to UNCONFIRMED.
Comment 28 Stéphane Guillou (stragu) 2024-08-12 00:47:39 UTC
(In reply to Lee from comment #27)
> The problem still exists [at]
> https://gerrit.libreoffice.org/gitweb?p=core.git;a=log;
> h=2fec61240fed71923e5e2172e8536438df2a2432
> [...] I've set status to unconfirmed only
> because of the wording at the right
Thanks for testing again. Let's set back to "New".

Ismo and libreoffice@dreamchaser, would be great if you could also test a recent daily build to see if you have the same issue as Lee or if you were actually hitting bug 154959.
Comment 29 libreoffice 2024-08-13 15:47:30 UTC
Bug still exists in 25.2.0.0.alpha0_Linux_x86-64
Tested on Framework laptop running ubuntu 22.04
As before, exporting to pdf and then printing that works.
Comment 30 libreoffice 2024-08-13 15:51:19 UTC
BTW, downloaded version was 2024-08-12 04:47:57 daily