Images and VML

Jun 30, 2009 at 9:52 PM

Hello, this is an awesome tool!  I have been writing one of my own for some time now and got most of the functionality going.  However i ran into a few snags:

  • VML to SVG i could not figure out.  How are you guys achieving this?
  • Image placement doesnt translate well to HTML

For the VML thing i assume you guys are just using an XSLT transform?

For the images, how does the tool handle images that are placed by users dragging them?  i.e. not in a nice little paragraph, but placed arbitrarily.  Absolutely positioned elemnts in HTML lose text wrapping.


Jul 1, 2009 at 5:17 AM


Thanks a lot for the compliments. Excellent questions there. I will take them one by one.

  • VML to SVG - This is being handled in C++. We considered the option of using XSLT for the conversion. But since the VML present in word is embedded with Office tags, we considered that C++ would be a better way forward. Performance also was a consideration.

The conversion is handled inVML2SVG.cpp in the source files.

  • You are correct again with image placements. Handling arbitrary positioning of image and text wrapping is something we decided not to support in OpenXMLViewer, as there are multiple ways in which the text and images can be positioned. Hence, you may find that text wrap and image positioning may not be 100% accurate. However, it will work for most scenarios.

A similar case would be that of multiple column text. The support for the same was removed due to performance constraints.



Jul 1, 2009 at 7:13 PM

Thanks for the reply.  I'll take a look at the VML2SVG.  This validates my shortcomings :)  I'm thinking if i am going to dig into the VML programatically, i'll try to convert to <canvas>.  This way IE and FF(else) will be covered :)

Jul 2, 2009 at 6:02 AM

If licensing is not an issue, I suggest that you look into VectorConverter at Sourceforge. They have an XSLT based VML to SVG to Gif converter that works pretty well.

<canvas> sounds like a good approach as well, with a little bit more of effort!