使用openxml sdk将html内容添加到单词docunemt的主体中 [英] Adding a html content to the body of the word docunemt using openxml sdk

查看:109
本文介绍了使用openxml sdk将html内容添加到单词docunemt的主体中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


   我想使用openxml将示例html内容附加到word文档的body部分。请查找示例内容以供参考



"< html> < HEAD> < title>< / title>"



 




+


 






"< / head> <身体GT;看看有多酷< font
size ='x-large'>< b>打开Xml< / b>< / font>。现在使用< font color ='red'>< u> HtmlToOpenXml< / u>< / font>,"


+


 






"它很容易转换为html。 < p为H.
如果您喜欢,请在< a href ='http://notesforhtml2openxml.codeplex.com'> codeplex< / a>"


+


 








"< / p为H. < HR> < /体> < / html>"






当我尝试添加内容时,它显示为纯文本而不是html内容。可以为此提供解决方案或代码。


 


问候


R.Rajesh

解决方案

Hi Rajesh


HTML需要转换或转换为Word Open XML词汇表,然后插入document.xml文件中的正确位置。我想有第三方工具可用(例如来自AltSoft)。


在OpenXMLDeveloper论坛中,我发现了一个关于codeplex工具的讨论,可以追溯到几年前。 br />
http:// openxmldeveloper。 org / discussion / formats / f / 13 / p / 2466 / 8169.aspx#8169


工具上的开发显示为继续并且有效。


Hi,

    I want to append a sample html content to the body section of the word document using openxml.Please find the sample content for reference

"<html> <head> <title></title>"

 

+

 

"</head> <body> Looks how cool is <font size='x-large'><b>Open Xml</b></font>. Now with <font color='red'><u>HtmlToOpenXml</u></font>,"

+

 

"it nevers been so easy to convert html. <p> If you like it, add me a rating on <a href='http://notesforhtml2openxml.codeplex.com'>codeplex</a>"

+

 

"</p> <hr> </body> </html>"

when i tried to add the content,it displayed as a plain text and not as html content.Can someone provide a solution or code for this.

 

Regards

R.Rajesh

解决方案

Hi Rajesh

The HTML needs to be converted or transformed to the Word Open XML vocabulary then inserted into the correct place in the document.xml file. I imagine there are third-party tools available (from AltSoft, for example).

In the OpenXMLDeveloper forum I find a discussion that dates back a couple of years about a tool on codeplex:
http://openxmldeveloper.org/discussions/formats/f/13/p/2466/8169.aspx#8169

It appears development on the tool as continued and that it works.


这篇关于使用openxml sdk将html内容添加到单词docunemt的主体中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆