I am using LibreOffice 4 and Java Uno API for managing documents.
I've got situation where I am importing HTML documents with img tags to LibreOffice via Java Uno API and save document in other formats (such as odt, docx, doc, rtf).
The problem is that LibreOffice converts img tags to graphic objects with links (not embedded in document).
I was trying to use html base64 but it seems that LibreOffice doesn't support that.
Now I want to convert these linked graphic objects to embedded graphics objects.
I am able to iterate through images via XTextGraphicObjectsSupplier but I can't figure it out how to make these objects embedded.
Is it possible?
Maybe it is possible to make some magic attribute in html img tag and LibreOffice will embed it?
It seems that libre/open office doesn't support this option. Only way is to remove and again insert embedded image, but you must be aware of formating (e.g. size etc.). I achieved my goal by doing these steps (WARN it is hack...):
Pictures
in unzipped directory and move there all images.content.xml
and replace path to system files to Pictures/file-name
.META-INF/manifest.xml
and something like this <manifest:file-entry manifest:media-type="image/png" manifest:full-path="Pictures/file-name"/>