0

I need to allow pasting HTML from our secure web app to MS Word (2007 and above) - it works fine but MS Word doesn't support Data URI like images . Data URL's work, but because of network/security issues I cant use it .

I could use MHTML for this ? If so how to convert the below simple HTML to MHTML ? We use Python backend - so html to doc converters would also be a worthy try or any good approach would be fine .

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
Nishant
  • 20,354
  • 18
  • 69
  • 101

1 Answers1

2

MHTML conforms to the Mime spec. In Java, I have generated it successfully using the javamail API, so Python classes that generate mime-encoded emails may work for you.

Unfortunately, Word, Excel, and Explorer are uneven in how they interpret MTHML. Unless the page is simple, it is unlikely to render exactly the same as the original HTML looked.

chrishmorris
  • 287
  • 1
  • 6