Bug 104648 - Opening a PDF file in draw and inserting a PDF file in draw to then break it is not equivalent
Summary: Opening a PDF file in draw and inserting a PDF file in draw to then break it ...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.3.0.0.beta2
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-13 16:41 UTC by Callegar
Modified: 2016-12-14 14:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Sample case (98.67 KB, application/pdf)
2016-12-13 16:41 UTC, Callegar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Callegar 2016-12-13 16:41:40 UTC
Created attachment 129597 [details]
Sample case

LibO 5.3 has a nice functionality to insert PDF files as images.

Once the PDF file is included, one can "break" it to convert it to a series of native LibO graphic objects that can be edited.

In principle, the above should be equivalent to directly opening the PDF file in draw, which imports the PDF drawing as a series of LibO graphic objects that can be edited.

However, there are many PDF files that open fine in draw and that get slightly mangled when inserted as images and then broken.

Specifically, the PDF file gets inserted correctly, but then, when breking it, some of its elements get misplaced and spurious background layers appear.

The attached file is a very simple example.

When opened as a drawing in draw, it opens perfectly. If you click on the background of it, e.g. slightly to the left of the "vi [V]" x-axis label, you see that there is a white background layer, i.e. a white rectangle as large as the image acting as the image background. 

When inserted in draw as an image it initially looks perfect. However, when you break it, the [V] label of the y axis of the plot gets badly misplaced. Furthermore, there are spurious "background" layers. If you click on the background,  e.g. slightly to the left of the "vi [V]" x-axis label, you see that there is a white background layer, i.e. a white rectangle as large as the image acting as the image background. If you erase it, and you click again in the same point, you find another identical white rectangle. If you erase it and you click again in the same point, you find a third identical white rectangle.
Comment 1 V Stuart Foote 2016-12-13 21:02:51 UTC
(In reply to sergio.callegari from comment #0)
> ... 
> In principle, the above should be equivalent to directly opening the PDF
> file in draw, which imports the PDF drawing as a series of LibO graphic
> objects that can be edited.
> ...

Not at all. They use two completely different import filters meeting different requirements.

There really is no reason to expect similar results with a break  apart of a single inserted PDF image versus the object creation done during import opening into Draw.
Comment 2 Callegar 2016-12-14 14:09:49 UTC
Indeed. I have just noticed that converting the same graphical elements into a metafile and then breaking it back into pieces results exactly in the same kind of mangling. Hence, it is not something specific to PDF, rather general to the "breaking apart".

Should this be reported as a bug in the "breaking apart" process, then?
Comment 3 V Stuart Foote 2016-12-14 14:37:18 UTC
(In reply to sergio.callegari from comment #2)
> Indeed. I have just noticed that converting the same graphical elements into
> a metafile and then breaking it back into pieces results exactly in the same
> kind of mangling. Hence, it is not something specific to PDF, rather general
> to the "breaking apart".
> 
> Should this be reported as a bug in the "breaking apart" process, then?

Yes, a new issue report would be correct--thanks!

But please give the devs a chance by providing precise Steps to Reproduce, and include simple test case documents--i.e. an SVM meta, an SVG, and then maybe the same in PDF--with screen clips that demonstrate the issues when breaking an image into draw objects.