Bug 153851 - Print to File default to A4 instead of actual page size since 7.5
Summary: Print to File default to A4 instead of actual page size since 7.5
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.5.0.0 beta1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Print-Dialog
  Show dependency treegraph
 
Reported: 2023-02-27 10:31 UTC by Stéphane Guillou (stragu)
Modified: 2023-11-05 13:21 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
example A5 document (11.14 KB, application/vnd.oasis.opendocument.text)
2023-02-27 10:31 UTC, Stéphane Guillou (stragu)
Details
buggy XHTML export (deleted)
2023-05-11 15:43 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-02-27 10:31:46 UTC
Created attachment 185603 [details]
example A5 document

Steps:

1. Open Writer, go to Format > Page Style > Page > Paper Format > Format: change to A5. (Or open attachment)
2. File > Print (or Ctrl + P)
3. Printer: Print to file...

Results:
- Preview uses A4
- Resulting PDF file is A4

Export to PDF is unaffected.

Repro in 7.5 and recent master build:

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

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

LO 7.4 would use the correct page size:

Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 1 Roman Kuznetsov 2023-02-27 10:41:03 UTC
I got the .PRN file if I use Print to file variant in the Print dialog. Why did you say about some PDF as result?

No repro in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c3bd52f81bf733a0b9b0560794a54b2ac1e0f444
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 2 Stéphane Guillou (stragu) 2023-02-27 11:13:04 UTC
Bibisected with linux-64-7.5 repo to first bad commit a5affb5561faf69abfcdebe824afcb89ccbda8fd which points to:

commit db04b3e154a1fb8f222232ef969bb3617e051329
author	Noel Grandin <noelgrandin@gmail.com>	Sat Aug 20 10:57:19 2022 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	Mon Aug 22 09:35:31 2022 +0200
tree 84195e6f47abd82024127ced37405585df7708bb
parent b2b3b4e833484aa70cb73b296bb62cdb0304eac9
return 64-bit hash for O[U]String
which gives better performance when putting strings into hashed
containers that expect good key distribution.
This hash implementation is the same one that Java uses.
Change-Id: Iae5cf3cd27309856acfa51781295f2e56c8e77db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138574

Noel, what do you think?
Comment 3 Dennis Roczek 2023-02-27 13:17:41 UTC
also confirmed in 7.5.0.3 released.

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: 50(Build:3)
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.5.0~rc3-0ubuntu0.22.04.1~lo1
Calc: threaded

funny part: it is not seen in the LO print dialog, but in the generated PDF itself.
Comment 4 Stéphane Guillou (stragu) 2023-02-27 13:43:00 UTC
(In reply to Dennis Roczek from comment #3)
> funny part: it is not seen in the LO print dialog, but in the generated PDF
> itself.

You're right, Dennis, the preview is not always A4: it depends on whatever was selected before changing the printer to "Print to file...", and therefore depends on what paper sizes are supported for that printer.

Regardless of what the greyed-out field shows, and what the preview shows, what comes out is an A4 PDF.

Revised results:
- PDF file is A4 regardless of the paper format in Page Style.
Comment 5 Noel Grandin 2023-04-17 08:07:27 UTC
On current master, I cannot repro this
Comment 6 Stéphane Guillou (stragu) 2023-05-05 21:03:12 UTC
I can still reproduce in a recent master:

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

And 7.5.3:

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

Print to File results in A4 (wrong). PDF export results in A5 (correct).
Checked gen VCL as well, same issue.
However, not reproduced on macOS, using File > Print > PDF.

Noel, what did you test on?
Comment 7 Noel Grandin 2023-05-06 14:32:58 UTC
I can't seem to repro this on Linux, with gcc or clang. On Ubuntu 22.10.
Which distro/version are you using?
Comment 8 Stéphane Guillou (stragu) 2023-05-09 12:11:41 UTC
Ubuntu 20.04 with GNOME 3.36.8 + Wayland.
Dennis, what is your system?
Comment 9 Dennis Roczek 2023-05-10 07:34:29 UTC
Ubuntu 22.04; gnome  42.5 incl. Wayland...

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 4:7.5.2~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded

but just retestet: no repro any longer...
The PDF is getting a A5 paper and everything looks as it should be.
I had to reinstall my printer in the last ~2m because of changing the IP net.
Comment 10 Stéphane Guillou (stragu) 2023-05-11 15:40:41 UTC
(In reply to Dennis Roczek from comment #9)
> but just retestet: no repro any longer...
> The PDF is getting a A5 paper and everything looks as it should be.

Just checking: you used Print to File, and not export to PDF, right?
Comment 11 Stéphane Guillou (stragu) 2023-05-11 15:43:58 UTC Comment hidden (off-topic)
Comment 12 Stéphane Guillou (stragu) 2023-05-11 15:45:27 UTC
The content of attachment 187203 [details] has been deleted
Comment 13 Dennis Roczek 2023-05-25 07:55:55 UTC
(In reply to Stéphane Guillou (stragu) from comment #10)
> (In reply to Dennis Roczek from comment #9)
> > but just retestet: no repro any longer...
> > The PDF is getting a A5 paper and everything looks as it should be.
> 
> Just checking: you used Print to File, and not export to PDF, right?

uhm, missed that mail: yes, of course. Hence my surprise that this time it worked for me.
Comment 14 Stéphane Guillou (stragu) 2023-11-05 13:21:29 UTC
Hm I can't reproduce anymore for some reason, even at the bibisected commit.
Marking as "works for me", but if you can provide some steps to reproduce consistently, Dennis, please do share...