Bug 150875

Summary: Hatch pattern scaling depends on DPI (screen scaling) on PDF export
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: Printing and PDF exportAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: stephane.guillou, telesto
Priority: medium    
Version: 7.4.1.2 release   
Hardware: All   
OS: Windows (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=150786
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103378, 112579    
Attachments: Export with screen scaling 100% vs 150%

Description Mike Kaganski 2022-09-09 06:30:50 UTC
Created attachment 182330 [details]
Export with screen scaling 100% vs 150%

Using the unit test document for tdf#147027, run this command line:

> soffice --convert-to pdf vcl/qa/cppunit/pdfexport/data/tdf147027.ods

Depending on current desktop scaling, the hatch pattern used in the chart would have different scale in the output PDF.

The attached screenshot shows the difference with two screen scaling values using

Version: 7.4.1.1 (x64) / LibreOffice Community
Build ID: 0a046a10cbf1679eea5538bd3ab63156caa3a036
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

The same result would be with documents created from scratch:
1. In a new Writer document, insert a shape;
2. In its area properties, select a hatch pattern;
3. Use toolbar button to export to PDF.

Before a workaround implemented in commit 3801a45eb8e82095d5f1a65ad1646e300a900bdd, the respective unit test failed on screen scaling other than 100% with:

> C:/lo/src/core/vcl/qa/cppunit/pdfexport/pdfexport.cxx(2253) : error : Assertion
> Test name: `anonymous namespace'::testTdf147027::TestBody
> equality assertion failed
> - Expected: 778
> - Actual  : 1754
Comment 1 Stéphane Guillou (stragu) 2023-07-18 17:24:06 UTC
No repro in 7.4.7.2 nor in 7.5.4.2 on Ubuntu 20.04 with GNOME 3.36.8.

As with other issues in which OS scaling interferes with images and fills, might be Windows-only, I can check later.