Bug 101142 - Print preview picks the color from the document background option (should be wysiwyg even in dark mode)
Summary: Print preview picks the color from the document background option (should be ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high normal
Assignee: Heiko Tietze
URL:
Whiteboard: target:25.8.0 target:25.2.3
Keywords:
Depends on:
Blocks: Print-Preview
  Show dependency treegraph
 
Reported: 2016-07-26 22:44 UTC by RGB
Modified: 2025-04-03 04:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2016-07-26 22:44:01 UTC
On Writer, go to Tools → Options → LibreOffice → Application colors and change the "Document background" to something different from default, let's say "Gray 1". This color should only apply "on screen" during edition and in fact if you export to PDF or go to the the Print dialogue, the page will be white. But if you activate the "Print preview" using the corresponding Standard toolbar button (or Ctrl-Shift-O) you'll see the page presented with the background color you choose for the *application*, which is wrong: print preview must display how the print output will be, not the editor display.
Comment 1 Buovjaga 2016-08-05 18:01:49 UTC
Yep.

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 QA Administrators 2017-10-23 14:12:32 UTC Comment hidden (obsolete)
Comment 3 Thomas Lendo 2018-10-11 21:24:05 UTC
Still reproducible.

Version: 6.2.0.0.alpha0+
Build ID: 425af6845ebe066c950b0b63f50563e067485f3e
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: de-DE (de_DE.UTF-8); Calc: threaded
Comment 4 QA Administrators 2019-10-12 02:44:46 UTC Comment hidden (obsolete)
Comment 5 RGB 2019-10-12 13:17:38 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2021-10-22 03:45:07 UTC Comment hidden (obsolete)
Comment 7 RGB 2021-10-22 20:05:56 UTC
Problem still present in 7.1.4 (openSUSE Leap build) and 7.2.2 (vanilla build)
Comment 8 Timur 2022-02-01 15:34:01 UTC
Repro 7.4+ in Windows, so All OS is correct.
Comment 9 RGB 2022-08-07 15:38:08 UTC
This is also true when picking LibreOffice Dark theme in Tools → Options → Application Colors: what's shown in print preview is NOT what you'll get when printing. Tested with 7.3.5 & 7.4.0rc2.
Comment 10 Rafael Lima 2022-11-06 18:20:11 UTC
Pressing Ctrl+P to open the Print dialog works as expected, with the white page background even when the document color is different.

However, the Print Preview (Ctrl+Shift+O) does not use the white paper color.

We could have a toggle in Print Preview so that the user can choose to "Use white background" during preview.
Comment 11 QA Administrators 2024-11-06 03:15:42 UTC Comment hidden (obsolete)
Comment 12 RGB 2024-11-06 16:46:47 UTC
The problem is still present in recent versions (both 24.8 and 25.2.alpha). You may need to restart the application after applying the background color to see the problem.
Comment 13 Christian Lohmaier 2025-03-27 10:06:56 UTC
bumping importance to high for the evaluation, since with 25.2 and the changed theme for the background in dark mode, this issue became way easier to trigger, even for users not manually setting different theme colors.

* Use LibreOffice in dark theme (default is to follow system theme, and many OS have a time-based system now or at least make it very easy to have a light or dark application theme
  * in 25.2 that also makes the workspace area dark
    (if users don't like that, they can apply the light application color theme and still get dark menus/toolbars while having the working area as in older versions)
* Print preview should be just that: showing what would be printed wrt formatting
  * no field shadings
  * field values, even when user picked field names for display while editing
  * no spellcheck wiggly-lines
  * no non-printing characters/formatting marks/characters
  * no border-lines on graphics/sections unless there's actual border applied
  those all work as expected, but in dark mode you get the light text on dark background as in editing

So please advise whether that's intentional or considered a bug, whether there should be an additional toggle or not
Comment 14 Heiko Tietze 2025-03-28 08:15:29 UTC
Is it a duplicate of bug 165085? Fixed in target:25.8.0 target:25.2.3 target:25.2.2
Comment 15 RGB 2025-03-28 19:48:54 UTC
(In reply to Heiko Tietze from comment #14)
> Is it a duplicate of bug 165085? Fixed in target:25.8.0 target:25.2.3
> target:25.2.2

No, it's not. That bug is about actual colors not changing, this one is about colors that should not apply on Print preview mode (using the corresponding Standard toolbar button or Ctrl-Shift-O) when you have for document background (what you see during editing) a different color than the actual color of the document (what you see when printing or exporting to PDF). Problem still present on 

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d986127690cf6b61e8973ee37e009a1f0dbbc9ca
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

Notice that if you change the document background color on 25.8 alpha (now the default is white even with a dark theme) you'll need to restart the application to see the problem.
Comment 16 Commit Notification 2025-03-31 13:50:43 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f597c3a6eaa6b45f43b127b9b042442516ddc202

Resolves tdf#101142 - Always use a white background for print preview

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2025-04-03 04:08:44 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/878219923ec07d5bf9003867833d77bd472d4e23

Resolves tdf#101142 - Always use the real background for print preview

It will be available in 25.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.