I'm using libreoffice in headless mode to convert HTML into various formats. For this question, we'll use docx for simplicity sake.
I use a command similar to this:
libreoffice --headless --convert-to docx:"MS Word 2007 XML" --writer document.html
This works great for the most part.
The HTML includes a couple of absolute links to images.
<img src="http://myserver.com/image1.jpg" />
When the document is converted to document.docx, the images are still being linked to, not embedded into the document. This causes problems when you're offline and in previews and such.
Is there a way that I can tell libreoffice to download and embed the images directly into the document instead of just keeping them as linked images?
LibreOffice currently (towards 6.3, but this is the situation since this change / 5.2) defaults to not embed images:
libreoffice --convert-to html test.odt
You can opt in to embed images like this:
libreoffice --convert-to html:'HTML (StarWriter):EmbedImages' test.odt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With