Bug 479333 - Unable to print non-A4 page sizes correctly with KDE applications
Summary: Unable to print non-A4 page sizes correctly with KDE applications
Status: REPORTED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_printer_manager (show other bugs)
Version: 5.27.5
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Daniel Nicoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-03 00:58 UTC by Leisquid Tianyi Li
Modified: 2025-01-02 20:50 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leisquid Tianyi Li 2024-01-03 00:58:09 UTC
SUMMARY
When printing with KDE applications such as Gwenview and Okular, the final page size or scaling output to the printer is incorrect, even if the page size is set to any particular value.
I originally found this problem when testing Canon printers. When I was printing with Gwenview and set the page size to a particular small size, some printers would print an image scaled to A4 size, while others would stop working and warn that the corresponding paper was missing - when querying the error details on the printer, it showed that the paper size required for the print job was A4. It was later tested that the output to the printer was still A4 regardless of the page size. Changing the default options for the printer didn't help.
The same problem occurs with CUPS virtual PDF printers, not just Canon printers.
But this problem doesn't occur if you print with non-KDE applications, such as GIMP or Chromium. I think that this bug is related to KDE applications, rather than printer drivers.

STEPS TO REPRODUCE
Take the CUPS virtual PDF printer as an example. If you have a physical printer, you can use it for testing as well.
1. Install cups and cups-pdf, and start the CUPS service.
2. Add a CUPS virtual PDF printer, or your physical printer.
3. Print an image or PDF document with any KDE application: open the "Print" dialog, click "Properties", and set Page size to a value different from A4. Orientation can also be set to "Portrait" or "Landscape".

OBSERVED RESULT
Printing results vary depending on the KDE application used. For example, when printing with Gwenview, the page size of the document output through the printer is A4, regardless of the page size selected; when printing with KolourPaint, the page size is correct, but the Orientation of the printed document is always Portrait, regardless of whether the Orientation is set to "Portrait" or "Landscape".

EXPECTED RESULT
Prints the correct image according to the page size and orientation settings.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux x86_64
Kernel Version: 6.6.8-arch1-1 (64-bit)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.11
Graphics Platform: X11
OpenPrinting CUPS Version: 2.4.7-2

ADDITIONAL INFORMATION
When a picture is being printed, the contents of the picture are processed and placed in a SPOOLing queue with a file name usually "dxxxx-xxx", sometimes as a PDF document. You will find that the page size, orientation, and scaling of this document are all correct if you open it. So I'm wondering if maybe the KDE applications are outputting wrong information about the print job?

Best regards,
Leisquid Li
Comment 1 Nate Graham 2024-02-15 22:17:35 UTC
Can you please paste the output of running `locale` in a terminal window?
Comment 2 Leisquid Tianyi Li 2024-02-16 01:13:20 UTC
(In reply to Nate Graham from comment #1)
> Can you please paste the output of running `locale` in a terminal window?

Okay. Here is the output of running `locale` in Konsole:

```
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
```

The language set in Plasma was Simplified Chinese when this problem was found in this environment. After that I set the language to English, did the same tests, and same problem occurred. Here is the output of running `locale` in the English environment:

```
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
```
Comment 3 Nate Graham 2024-02-16 18:24:11 UTC
Thanks.
Comment 4 Leisquid Tianyi Li 2024-02-17 00:39:10 UTC
(In reply to Nate Graham from comment #3)
> Thanks.

Oh you're welcome.

Best regards,
Leisquid Li
Comment 5 cberlinger 2024-11-21 16:29:41 UTC
I am having the same issue as well. It appears to impacts apps that use the native KDE print menu. Every last part of my system is set to US Letter (locale, system settings, printer config, CUPS), but every print or PDF export comes out in A4.  I really noticed it when trying to print vendor checks from the flatpak of GNUCash. It was almost enough for me to leave Plasma for GNOME just so that I could get back to work.  

Libreoffice, Firefox, and Chrome seem fine, but that is likely due to those apps using their own print subsystem.


***System Details***
Operating System: Fedora Kinoite Linux 41
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.7-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-4690K CPU @ 3.50GHz
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 480 Graphics