Bug 158246 - Intersection of two black path-segments in a PDF mis-rendered as white
Summary: Intersection of two black path-segments in a PDF mis-rendered as white
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/why-wil...
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2023-11-16 16:42 UTC by chanshun1121025
Modified: 2024-06-11 16:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF exported from OneNote (70.94 KB, application/pdf)
2023-11-23 13:18 UTC, Kjell Edvard Medhaug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chanshun1121025 2023-11-16 16:42:18 UTC
Description:
Currently i am working on my assigment. i prefer to do it in onenote and export it as pdf. When i try to edit my assignment in libre draw, i found that the intersection of those string become white. It goes same after save it without editing. i sure i did nothing to the file. the setting of libre office is also defult except i turn on the “force skia software rendering” and turn off OpenCL cause my cpu have no gpu intergrated and it will very slow when i turn it on and start editing my assignment.

Steps to Reproduce:
1.open onenote, draw sth on it and export it as pdf, make sure the drawing have intersection.

2.open the pdf with libre office, the intersection of lines become white.

3.it seems the problem only happen in those line drawed in my laptop, nomatter do i copy and paste it to a new page in onenote. the problem didn't occur when i draw in my desktop.tho

my laptop is ROG Z13 2023 with 4060 laptop and 13900h, i am using the touchscreen and asus pen to write my assignment. 

Actual Results:
the intersection of lines from my laptop become white. but those from my desktop have no problem occur.

Expected Results:
maybe this is the problem of how libre read the line object from pdf file especially those from touch screen? i dont know. i only know that i am often annoyed by PDF editors.


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-GB
Module: DrawingDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: yes

i only turn off the opencl and turn on the force using skia option
Comment 1 ajlittoz 2023-11-16 19:29:05 UTC
This bug report is a follow-on of https://ask.libreoffice.org/t/why-will-the-intersection-of-two-line-become-white/98304/

IMHO, behaviour is triggered by some attribute in the path description. I am thinking of some graphical mode setting the "algebra" of intersection. If this mode is set to XOR, then two overlaid strokes intersect as "white" or void. If mode is OR, we have the usual behaviour of combining strokes without changing the "colour".

A sample file is available in the linked AskLO question. Original bug reporter is encouraged to attach this sample file here.

The white intersection of strokes appears as soon as the PDF is opened in Draw, before any editing, which leads me suspect the "graphical algebraic mode".

I could not check the hypothesis because the shapes are hidden under a compressed "stream" in the PDF. It would be necessary to decompress the stream to access the drawing primitives. I don't know how to do that.

I'd put the blame on OneNote for incorrectly specifying the drawing mode. I am not favourable to changes in interpretation in Draw if my hypothesis is right because such a drawing mode can be intentionally set by user for its XOR special effect.
Comment 2 Kjell Edvard Medhaug 2023-11-23 13:18:04 UTC
Created attachment 190992 [details]
PDF exported from OneNote

Created in "Microsoft OneNote for Windows 10", version 16001.14326.21452.0, with Norwegian user interface. Exported to file using the integrated File - Export functionality in OneNote. Other file created by print-to-pdf, using the virtual printer driver supplied with Windows, displays identical behavior.

The file has random scribble objects made with the "pen" drawing tool in Microsoft OneNote. Some using default line width and some with wider line; some remain as freehand lines and some are converted automatically by OneNote to regular shapes (ellipse and circle).

The objects are rendered without "white-outs" in OneNote, and also in Adobe Reader.

When opened in Draw, there are white-outs where there is wide line overlapping wide line on the same object (crossing line on freehand object, rounded ends of "autocorrected" regular objects). 

- Overlapping between objects does not display any white-out. 
- Narrow line does not display any white-out.

Just a thought: 
Perhaps some combination of ...
- Coloration "XOR" when object ID or stacking order is identical?
- Wider lines defined by "contour vector" while narrow line is defined by simple vector + width, and crossing vector somehow confused with contour vector.
Comment 3 raal 2023-11-23 13:29:37 UTC
Confirm with Version: 4.1.0.0.alpha1+
Build ID: 5e77c9e17ba7dd9d296c9b755093f01e7eb4f51

and Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a91892ec4942fc875820ea02dfbe74e986548142
CPU threads: 4; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded