How to handle floating images in OpenXML and convert to html equivalent

467 views Asked by At

I am using OpenXML along with OpenXML Power Tools. So far I have managed to convert a lot of words functionality to html. The main point I can't yet figure out is floating images. I have taken the following example from PowerTools and slightly modified it to my needs. https://github.com/EricWhiteDev/Open-Xml-PowerTools/blob/1990e7f5bfd00a5e7aab2e074fa7fc0b1be7cd3a/OpenXmlPowerToolsExamples/HtmlConverter01/HtmlConverter01.cs

The ImageHandler part is where I get stuck. I can generate an image (and I've converted to base 64 so I don't have to worry about external images) but it always goes to the left (or follows manual tabbing), even though it's a floating image that goes horizontally in the middle with a slight gap at the top.

Has anyone any experience on how to achieve this?

1

There are 1 answers

0
stefan.seeland On

OpenXML Power Tools ignores all floating settings of images.

w:drawing with wp:inline and wp:anchor are handled the same way and result in the same html.