unoconv / unoserver

MIT License
592 stars 81 forks source link

Support for embedded images in HTML exports #110

Closed Kingdageek closed 6 months ago

Kingdageek commented 8 months ago

Hi guys,

So, the default behaviour of embedding images as base64 strings in output HTML files was changed for newer libreoffice versions. This was then made optional and you could specify this in the soffice commands like so:

soffice –headless --convert-to html:HTML:EmbedImages test_file.docx

Can support for this be added?

I already tried the following commands:

For the first command, a RuntimeError was raised that HTML:EmbedImages is not a valid filter name, and then a list of valid export filters was displayed. The second command successfully executed but didn't embed the images as base64 strings.

I then tried to check the source code to see if the export filters were say stored in some constant variable and it seems it's been fetched from the unohelper utility. Could say just checking the string before the ":" in the export filter validation work?

@regebro @strichter

regebro commented 6 months ago

https://github.com/unoconv/unoserver/issues/75 had a similar issue, maybe using the "XHTML Writer File" filter works better?

Kingdageek commented 6 months ago

Hi @regebro

thank you for your reply. It worked! It had slight issues with rendering bullet points though, I tried the same filter with the soffice command and it seems the formatting-related issues are directly from libreoffice. This is better for my use case though so, we could close this issue.