Bug 134312 - FILESAVE DOCX Embedded PDF file is not saved as OLE Object
Summary: FILESAVE DOCX Embedded PDF file is not saved as OLE Object
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 157699 (view as bug list)
Depends on:
Blocks: DOCX-OLE-Objects
  Show dependency treegraph
 
Reported: 2020-06-25 23:23 UTC by Pablo
Modified: 2023-10-11 22:46 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example odt with pdf file embedded as icon (16.57 KB, application/vnd.oasis.opendocument.text)
2020-10-16 19:18 UTC, NISZ LibreOffice Team
Details
The example file saved to docx with current Writer (6.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-10-16 19:18 UTC, NISZ LibreOffice Team
Details
The odt and its docx version when the PDF icon is clicked (74.12 KB, image/png)
2020-10-16 19:20 UTC, NISZ LibreOffice Team
Details
The current state of the problem. (114.58 KB, image/png)
2022-04-22 07:10 UTC, NISZ LibreOffice Team
Details
Image of the problem (180.20 KB, image/jpeg)
2022-04-22 08:08 UTC, Attila Bakos (NISZ)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo 2020-06-25 23:23:23 UTC
Description:
When I want to insert a file (in my case a pdf) into the .docx document as a OLE object it is not saved. 
I wanted to insert the file as an icon into the document and save it under this extension (docx). It inserts the icon and the file while it is still open, but when I save it I realize it did not saved it because the weight of the document does not change as to having inside the other file. 
When I re-open the document it does have the icon but it does not longer access the file I inserted as OLE object.
When I save it as odt it does insert the file though. 
So it is a bug for the docx extension but not the program as a whole.

Steps to Reproduce:
1. Create a .docx document
2. Insert a file that already present in the computer as an OLE object (as an icon)
3. Save the document as .docx
4. Re-open the document, go to the icon for the OLE object. Double click it and you may experience the file was not saved inside the document.
5. Go to the icon of the 

Actual Results:
The document remains without the OLE object but the icon inside the document.

Expected Results:
The document should have the file inside so when I click on the icon of the OLE object it opens on the other program. (in my case the pdf viewer)


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
OLE
Comment 1 Julien Nabet 2020-06-26 06:33:52 UTC
On which Linux distrib are you and with which version?

6.0 like 6.1, 6.2 and soon 6.3 branch is EOL.
Could you give a try to last stable LO version 6.4.4?
Comment 2 NISZ LibreOffice Team 2020-10-16 19:18:01 UTC
Created attachment 166441 [details]
Example odt with pdf file embedded as icon
Comment 3 NISZ LibreOffice Team 2020-10-16 19:18:51 UTC
Created attachment 166442 [details]
The example file saved to docx with current Writer
Comment 4 NISZ LibreOffice Team 2020-10-16 19:20:34 UTC
Created attachment 166443 [details]
The odt and its docx version when the PDF icon is clicked

ODT stores the PDF, but DOCX does not. Happens in:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: c064766901722082df0d759c95434c1460fcdba5
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 5 NISZ LibreOffice Team 2020-10-19 08:26:39 UTC
@Daniel, Attila: I thought you might be interested in this one.
Comment 6 Attila Bakos (NISZ) 2022-04-20 13:25:42 UTC
(In reply to NISZ LibreOffice Team from comment #4)
> Created attachment 166443 [details]
> The odt and its docx version when the PDF icon is clicked
> 
> ODT stores the PDF, but DOCX does not. Happens in:
> 
> Version: 7.1.0.0.alpha0+ (x64)
> Build ID: c064766901722082df0d759c95434c1460fcdba5
> CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
> Locale: hu-HU (hu_HU); UI: en-US
> Calc: CL

please recheck because that file has an odg file inside not a pdf. in case of pdf unable to repro with:

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d3c22b1d4754e95a0fbb801a73295e5a4353f38f
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 7 NISZ LibreOffice Team 2022-04-22 07:09:14 UTC
I checked this bug with creating a new docx file with Writer.
But the problem is still exist.
I attached a picture about the problem (Test.png).

Description:
The created docx file re-opening in Writer the OLE object is a picture.

Steps to Reproduce:
1. Open a new Text document in Writer.
2. Insert -> Object -> OLE object
3. Create from file
4. Search -> choose a pdf document
5. Display as icon
6. Ok
7. Save as -> .docx
8. Close Writer -> Open it
9. Re-opened Saved docx

Actual result:
The created OLE object is a picture.

Expected result:
The OLE object behave like an OLE object. 

Reproduction:
Always

Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a98971ac975e19efa2336b608506eefa85ce2485
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 8 NISZ LibreOffice Team 2022-04-22 07:10:14 UTC
Created attachment 179718 [details]
The current state of the problem.
Comment 9 Attila Bakos (NISZ) 2022-04-22 08:08:10 UTC
Created attachment 179719 [details]
Image of the problem

Wow. There is two way to insert pdf, and that steps pointed me the second version.
Firstly i tried it with Insert->Object->OLE Object->further objects and then selected the file. That works.
The second way, where the issue exists is the following; Insert->Object->OLE Object and then selecting the "Create from file" option.
I think the major difference -- except from the issue -- in the first case the OLE will be an OLE package object, however in the second case it become an odg file, as i noticed before. The problem is, the export filter found this odg ole and fallbacks to image export, because odg has no pair in MSO.
Solution can be disabling the pdf -> odg conversion and embedding the pdf as it is.
My attachment shows that issue with the odg.
Note: After insertion of the pdf ole it becomes odf, and cannot be saved to pdf, only that way if i export it with Draw. but that can be an other issue.
Comment 10 m_a_riosv 2023-10-11 22:46:10 UTC
*** Bug 157699 has been marked as a duplicate of this bug. ***