Bug 148884 - LibreOffice Draw dark color scheme background color leaks to the exported PDF
Summary: LibreOffice Draw dark color scheme background color leaks to the exported PDF
Status: RESOLVED DUPLICATE of bug 38065
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected)
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Keywords: implementationError
Depends on:
Reported: 2022-05-02 09:39 UTC by Mehrad Mahmoudian
Modified: 2023-05-09 21:36 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

A screenshot of the settings I'm pointing at in this bug report (72.70 KB, image/png)
2022-05-02 09:39 UTC, Mehrad Mahmoudian

Note You need to log in before you can comment on or make changes to this bug.
Description Mehrad Mahmoudian 2022-05-02 09:39:22 UTC
Created attachment 179887 [details]
A screenshot of the settings I'm pointing at in this bug report

The issue is rather simple but I never stumbled upon it before: when I set the color scheme of the whole LibreOffice to "LibreOffice Dark", the exported PDF will have dark background even though the page background has been set to "none".

How I have set the color scheme:
1. LibreOffice Draw > Tools menu > Options
2. in the left-side menu click on LibreOffice > Application Colors
3. in the "Color Scheme" section and in-front of "Scheme" from the dropdown menu select "LibreOffice Dark"
4. Click on "Apply" and then the "Ok" buttons at the bottom-right side of the window

How I have made sure the page background is "transparent:
1. Right-click somewhere outside of any object (e.g move your mouse completely outside of the page)
2. click on "Page Properties..."
3. in the opened window, navigate to the "Background" tab
4. click on "None"
5. Click on "Ok" button at the bottom-right side of the window

When I open the PDF in Inkscape, there is a dark rectangle at the lowest level of the imported objects.

As far as I can understand, the logic behind a dark color scheme is not to have the actual colors of the document messed up, but rather have a dark theme while working on a document. In LibreOffice Writer or the LibreOffice Calc, the text that has the color "Automatic" will be displayed with a color that has a good contrast with the background, but when saved or exported, other people will see those files based on their own color scheme, even in Microsoft Office. I completely like this logic and for that reason I strongly believe this is a bug in LibreOffice Draw.

Also note that I have defined some custom colors in the LibreOffice Dark color theme (as the section header also clearly implies). The "Font color" is set to "Automatic", but the "Document background" is set to a color that doesn't hurt my eyes. Therefore, this bug might have some roots in how the Draw is parsing the scheme. With the same color scheme, Writer and Calc work beautifully and without any issues.

Based on my tests, this only happens in LibreOffice Draw, but I might have missed something, so please also do your testing if needed.
Comment 1 Scott Clewell 2022-05-31 00:08:22 UTC
Good day Mehrad and thank you for taking your time to report.

I agree that "user interface" options should not effect the document background. Under the "light" option, the document background is "automatic" and would change per users settings.

I believe this is a needed enhancement and have cc'd the UX team for review.

UX Team: thank your for your time in this matter!
Comment 2 Heiko Tietze 2022-05-31 07:00:42 UTC
Clearly a bug, export should use page > background settings not the application color. And None means none.

Happens only for Draw/Impress and not Writer or Calc.
Comment 3 Buovjaga 2022-06-06 16:33:29 UTC
I guess it's an implementation error from bug 141986
Comment 4 Heiko Tietze 2022-06-22 10:53:26 UTC
Seems to be related to https://bz.apache.org/ooo/show_bug.cgi?id=75566, but any return value at SdrPage::GetPageBackgroundColor() is ignored on export.

Whether the actual (dark) DOCCOLOR is used or calculated to white depends on the selection. If this option is checked the background is white.
Comment 5 Caolán McNamara 2022-11-08 09:50:48 UTC
This is a similar xls-specific case to bug #151610
Comment 6 Commit Notification 2022-11-09 10:58:14 UTC Comment hidden (off-topic)
Comment 7 Caolán McNamara 2022-11-13 17:26:40 UTC
used wrong bug id for the unrelated commit above
Comment 8 Stéphane Guillou (stragu) 2023-05-09 21:27:35 UTC
*** Bug 154969 has been marked as a duplicate of this bug. ***
Comment 9 Stéphane Guillou (stragu) 2023-05-09 21:36:39 UTC

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