Bug 61658 - Batch convert objects to pictures in writer documents
Summary: Batch convert objects to pictures in writer documents
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 139799 (view as bug list)
Depends on:
Blocks: OLE-Object-Interoperability
  Show dependency treegraph
 
Reported: 2013-03-01 09:01 UTC by andis.lazdins
Modified: 2021-01-21 09:47 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andis.lazdins 2013-03-01 09:01:06 UTC
The biggest compatibility problem for me in Libreoffice writer is export of charts, formulas and other objects, when saving documents in Microsoft word copatible formats like doc or docx. The objects are not visible in word or they are destroyed, or thay cannot be copied to other word documents, even if they are visible (because libreoffice or openoffice.org is installed on host machine).

Conversion of every single chart into picture is time consuming, therefore macro command, that can do it at once (batch conversion) would be very welcome.

There is simple macro for word to convert all objects into pictures. Probably it can be converted into Libreoffice macro code to do the same job:

Sub ConvertOLEObjectsToPicture()
  Dim Item As InlineShape
  For Each Item In ActiveDocument.InlineShapes
    Select Case Item.Type
      Case wdInlineShapeEmbeddedOLEObject, wdInlineShapeLinkedOLEObject
        Item.Select
        With Selection
          .CopyAsPicture
          .Delete
          .PasteSpecial DataType:=wdPasteMetafilePicture
          '.ShapeRange.WrapFormat.Type = wdWrapTopBottom
        End With
    End Select
  Next
End Sub

Origin: http://answers.microsoft.com/en-us/office/forum/office_2010-customize/how-to-convert-all-embedded-objects-in-word-to/d0b50e67-ef56-4392-8da0-9bf589dc711a

Bad thing in this macro is that it do not follows to original anchoring rules, so anyway all converted objects should be anchored separately.

It would be reasonable to have this macro separately, probably as extension, to be able to use in in openoffice 2.4, because all libre and open office versions after 3 has fatal regression in exporting complex tables, therefore 2.4 has to be used to export documents to word compatible format.
Comment 1 Owen Genat (retired) 2013-11-22 05:06:34 UTC
To be clear this enhancement request seems to be requesting a macro to batch export "charts, formulas and other objects" that have been inserted into a Writer document. This can currently be done only rather crudely via File > Save As... > selecting File Type of "HTML Document (Writer)" which produces a series of GIFs. 

Status set to NEW. Version set to Inherited from OOo.
Comment 2 Timur 2014-11-03 14:07:33 UTC
Seems like Bug 51550? It was about problem with saving OLE objects, and the bug was closed as fixed because those objects are now not lost, but now they can be saved only as images.
Also, from Bug 49229 we can see that equations are now properly saved (except layout issue related to wrap settings).
Since this bug is rather old, and unlikely to draw any attention as per this general problem description, I suggest it be changed to "FILESAVE as DOCX saves embedded OLE objects as pictures", so that development can continue here.
Comment 3 andis.lazdins 2014-11-03 14:17:58 UTC
Things are really changed since posting of the original report. I would say that conversion of formulas is  nearly excellent, but for charts and drawings the easiest way would be to have original chart or drawing stored and pictures visible in the doc or docx version of the document. Original would be good, if the document is opened and edited in the libreoffice. It could be also batch conversion macro to run by user.
Comment 4 Timur 2021-01-21 09:47:59 UTC
*** Bug 139799 has been marked as a duplicate of this bug. ***