开发者

Prevent Word from Reformatting my HTML

开发者 https://www.devze.com 2022-12-29 17:39 出处:网络
I have an HTML page that needs to open in word. I created the document in word and saved the document as an HTML document. So word spits out all its nasty HTML syntax. Thi开发者_StackOverflows is the

I have an HTML page that needs to open in word. I created the document in word and saved the document as an HTML document. So word spits out all its nasty HTML syntax. Thi开发者_StackOverflows is the opened through internet explorer which will display the word document within the browser.

When I view the page word modifies some of the tags. More specifically it adds a Width and Height tag and ignores the width and height within the style tag. If I try setting the Width and Height tags it overrides with new values. I have tested on different environments and get different results as word makes decision how to handle.

A bit of background this img starts off as this, and is rendered via data rendering syntax.

<asp:Image id="as" runat="server" Src"<%# ImgSource %>" style="width:178px;height:130px" />

It ends up like this in word

<img width=32
          height=32 id=barCodeImage
          src="http://myurl/BarcodeImages/1136574_129180418198008169.png"
          style='border-bottom-width:0px;border-left-width:0px;border-right-width:0px;
          border-top-width:0px;height:130px;width:178px'>

I want to stop word from reformatting the HTML.


Try Saving the page with the format "Webpage(Filtered)" in word.... I was compiling a help file and using the filtered save most of the words meta tags removed.....

0

精彩评论

暂无评论...
验证码 换一张
取 消