Bug 153851 - Print to File uses default printer's automatically picked Paper Size instead of matching Page Style
Summary: Print to File uses default printer's automatically picked Paper Size instead ...
Status: RESOLVED DUPLICATE of bug 152272
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-27 10:31 UTC by Stéphane Guillou (stragu)
Modified: 2024-05-08 07:52 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 Comment hidden (obsolete)
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...
Comment 15 Stéphane Guillou (stragu) 2024-05-08 07:52:36 UTC
Setting back to new. This depends on wether the printer that is selected by default supports A5 or not.

For example, on my Ubuntu 22.04 with CUPS-BRF-Printer set as default, the preview is A4 when opening the Print dialog, and changing to "Print to File" sticks to A4.
However, if I change my default printer to a physical one that does give a choice of A5 in the Paper Size dropdown, the preview is A5 and changing to "Print to File" sticks to A5.

So, updated steps:

0. Make sure system's default printer is a printer that does not list A5 in its Paper Size dropdown
1. Open attachment 185603 [details]
2. File > Print (or Ctrl + P)
3. Printer: Print to file...

Result: print to file uses whichever Paper Size was picked for the default printer (A4 in my case).

Not sure how I got to the bibisect result in comment 2, but it does not apply anymore. I can reproduce the same all the way back to OOo 3.3 (back when Print to File was a checkbox) - which is the same issue as bug 152272.

*** This bug has been marked as a duplicate of bug 152272 ***