Bug 82262 - Incorrect PDF import into Draw showing layers that should be masked
Summary: Incorrect PDF import into Draw showing layers that should be masked
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 86211
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2014-08-06 20:04 UTC by OfficeUser
Modified: 2024-11-25 02:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
issue.pdf (59.55 KB, application/pdf)
2014-08-06 20:05 UTC, OfficeUser
Details
issue.png (243.99 KB, image/png)
2014-08-06 20:06 UTC, OfficeUser
Details
Draw import of complex pdf (75.04 KB, image/png)
2014-08-08 18:43 UTC, Algot Runeman
Details
More minimal pdf (7.36 KB, application/pdf)
2024-11-22 01:42 UTC, Dave Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OfficeUser 2014-08-06 20:04:36 UTC
Hello,

please import the attached "issue.pdf" into Draw. The result is a bad import with big gray shaded areas (see also screen shot "issue.png").
Comment 1 OfficeUser 2014-08-06 20:05:07 UTC
Created attachment 104174 [details]
issue.pdf
Comment 2 OfficeUser 2014-08-06 20:06:07 UTC
Created attachment 104176 [details]
issue.png
Comment 3 Algot Runeman 2014-08-08 18:43:48 UTC
Created attachment 104308 [details]
Draw import of complex pdf

Test System:
Kubuntu 14.04 (KDE 4.13.2)
LibreOffice 4.3.0.3

The issue of Draw importing the horizontal, hatched stripes as a gray diagonal block occurs on my test system.

On LibreOffice 4.2.4.2, a similar import issue for the same hatched areas displays the hatching in diagonal lines. png image attached.

Thanks for reporting.
--Algot
Comment 4 V Stuart Foote 2014-08-10 17:31:49 UTC
The "shaded" areas are the cross hatching layer as applied to elements of the source document for the PDF. They should be hidden below other elements--but are visible when rendered in Draw.

Unclear what program Micron prepared the document in and used for export to PDF. 

When the document is opened in Adobe Reader, Adobe Acrobat, Adobe Photoshop, as well as with Inkscape--the hatching layer is correctly confined--and is not available as an object (e.g. all layers have been flattened). Only Adobe Illustrator did not recognize the format of the PDF.

As is, only LibreOffice incorrectly is showing the hatching layer but it is incorrect--if only a corner case.

On Windows 7 sp1, 64-bit en-US with
Version: 4.3.0.4
Build ID: 62ad5818884a2fc2e5780dd45466868d41009ec0
Comment 5 OfficeUser 2014-08-26 19:41:57 UTC
(In reply to comment #4)
> Unclear what program Micron prepared the document in and used for export to
> PDF. 

AH Formatter V5.3 R1 (5,3,2011,0425) for Windows
http://www.antennahouse.com/product/ahf50/ahf5top.htm

An "original" PDF can be found here:
http://www.micron.com/-/media/Documents/Products/Data%20Sheet/DRAM/DDR3/1Gb_DDR3_SDRAM.pdf

The version that I have attached to this bug report is an extract of a few pages.
Comment 6 V Stuart Foote 2014-08-26 21:36:58 UTC
(In reply to comment #5)
> An "original" PDF can be found here:
> http://www.micron.com/-/media/Documents/Products/Data%20Sheet/DRAM/DDR3/
> 1Gb_DDR3_SDRAM.pdf

Extracted the pages shown in attachment 104174 [details] (issue.pdf) but using Adobe Acrobat 9.5.5

When opened in Draw with a current LibreOffice Version: 4.4.0.0.alpha0+
Build ID: 32ce5ae15a8f156b4681c36d248b6731df3457c6
TinderBox: Win-x86@42, Branch:master, Time: 2014-08-25_01:27:12

The same unmasked view of the hatching layers are incorrectly being exposed in the PDF rendering in Draw.
Comment 7 vvort 2014-11-12 16:23:26 UTC
This lines must be clipped. See Bug 86211
Comment 8 tommy27 2016-04-16 07:28:29 UTC Comment hidden (obsolete)
Comment 9 OfficeUser 2016-04-23 20:00:38 UTC
Bug still present in:

Version: 5.1.2.2
Build ID: 1:5.1.2~rc2-0ubuntu1~trusty0
CPU Threads: 8; OS Version: Linux 3.16; UI Render: default; 
Locale: de-DE (de_DE.UTF-8)
Comment 10 QA Administrators 2017-09-01 11:19:45 UTC Comment hidden (obsolete)
Comment 11 OfficeUser 2017-09-16 09:11:55 UTC
Bug still present in
Version: 6.0.0.0.alpha0+
Build-ID: 115bed941d7b7ed1b95d6424bfb98456c1d87546
Comment 12 QA Administrators 2018-09-17 02:46:24 UTC Comment hidden (obsolete)
Comment 13 OfficeUser 2018-10-06 10:51:22 UTC
Still reproducible with:
Version: 6.1.2.1
Build-ID: 1:6.1.2~rc1-0ubuntu0.14.04.4
CPU-Threads: 8; BS: Linux 4.4; UI-Render: Standard; VCL: gtk2; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded
Comment 14 QA Administrators 2019-10-07 03:03:30 UTC Comment hidden (obsolete)
Comment 15 QA Administrators 2021-10-07 03:53:55 UTC Comment hidden (obsolete)
Comment 16 V Stuart Foote 2021-10-07 12:30:32 UTC
Issue remains with the pdf import filters, still depends on bug 86211 for correct clipping mask

The pdfium based insert as image handle the masking correctly

Version: 7.2.2.1 (x64) / LibreOffice Community
Build ID: 0e408af0b27894d652a87aa5f21fe17bf058124c
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 17 Dave Gilbert 2024-11-22 01:42:08 UTC
Created attachment 197717 [details]
More minimal pdf

I've been minimising this pdf by hand with the help of qpdf, and have got to this now tiny version.  It should have one lozenge and is still not clipped right.
This isn't as simple as a line clipping
Comment 18 Dave Gilbert 2024-11-25 02:16:40 UTC
The clip path is getting confused, because at one point it (correctly) should be empty; but the pdf import code is ignoring empty clip paths, so when the next clip path comes along, it uses this rather than staying empty.

So:

-    if( aCurClip.count() )  // #i92985# adapted API from (..., false, false) to (..., true, false)
-        aNewClip = basegfx::utils::clipPolyPolygonOnPolyPolygon( aCurClip, aNewClip, true, false );
+    aNewClip = basegfx::utils::clipPolyPolygonOnPolyPolygon( aCurClip, aNewClip, true, false );

helps things; but now we seem to have a new problem with some of the shading not being shown; so I need to track that down.

(A fun side part of this particular test file is it almost falls down my recent tilingPatternFill path which would have caused a blurred rendering, but that's a separate thing - I hadn't expected that to happen for what's closer to a shading)