Bug 44731

Summary: PDF import problems with gradients and patterns
Product: LibreOffice Reporter: mathog <mathog>
Component: DrawingAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: iamtester8, mathog, vvort
Version: 3.4.4 release   
Hardware: x86 (IA32)   
OS: All   
Whiteboard: Confirmed:4.2.0.2:OSX
i915 platform: i915 features:
Bug Depends on: 86211    
Bug Blocks:    
Attachments: Problem PDF
source SVG for the problem PDF
Screen shot of LODraw after opening the problem PDF
New gradient test (PDF)
New gradient test (SVG)
Clipping patch (experimental)

Description mathog 2012-01-12 09:34:18 UTC
Created attachment 55501 [details]
Problem PDF

Example PDF made by save as from Inkscape.  Looks fine in PDF viewers.  In LODraw
the gradient/pattern extends to the limits of the image.  3.5.0b2 does exactly the same thing.

This is a specific issue extracted from bug 43806
Comment 1 mathog 2012-01-12 09:34:53 UTC
Created attachment 55502 [details]
source SVG for the problem PDF
Comment 2 mathog 2012-01-12 09:35:39 UTC
Created attachment 55503 [details]
Screen shot of LODraw after opening the problem PDF
Comment 3 mathog 2012-01-20 11:01:32 UTC
Problem is unchanged in 3.5.0rc1 on Windows
Comment 4 tester8 2012-01-20 14:04:01 UTC
Reproduced with

LOdev 3.5.0beta3
e40af8c-10029e3-615e522-88673a2-727f724
Ubuntu 10.04.3 x86
Linux 2.6.32-37-generic Russian UI
Comment 5 foss 2014-01-21 10:36:28 UTC
Confirmed:4.2.0.2:OSX

OS > All
Comment 6 vvort 2014-04-26 14:52:03 UTC
Created attachment 98038 [details]
New gradient test (PDF)

Two types of bugs are mixed in provided test PDF (gradient.pdf): clipping and opacity.
Here is the new test files: gradient_test4.svg and gradient_test4.pdf
They are free from opacity bugs (and from big black rectangles as well).
Comment 7 vvort 2014-04-26 14:52:43 UTC
Created attachment 98039 [details]
New gradient test (SVG)
Comment 8 vvort 2014-04-26 15:05:58 UTC
Created attachment 98040 [details] [review]
Clipping patch (experimental)

Clipping must be performed without modifying of source objects.
But there is no such feature in LibreOffice Draw.
I have tried to implement modifying clipping.
But I was faced with two problems:
1. Radial gradients rendered by poppler as 256 polygons with 400 points.
That is bad for performance, but when clip is applied, situation becomes even worse.
2. Function basegfx::tools::clipPolyPolygonOnPolyPolygon() behaves badly in border cases. With my test file it fails 2 times: with radial gradient clipping and with pattern fill clipping.
Here is my experimental patch file.
Maybe it will be useful for someone.
Comment 9 vvort 2014-11-12 16:17:44 UTC
Bug 86211 contains newer version of clipping patch

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.