简体   繁体   English

使用Java将HTML页面转换为MS Word

[英]Convert HTML page into MS word using java

I want to convert a HTML page into MS word. 我想将HTML页面转换为MS word。 I want to know what API's will be helpful and also if there is any other option to do the same. 我想知道什么API会有所帮助,以及是否还有其他选择可以这样做。 The entire page is to be converted into .doc (eg. If there is a table in the html page, a similar table must be created in the word doc) Please help. 整个页面都将转换为.doc(例如,如果html页面中有一个表,则必须在doc词中创建一个类似的表)。

Have a look into the Apache POI library ... http://poi.apache.org/ it has read / write support for all of the Office products, from the site : 看一下Apache POI库... http://poi.apache.org/,它对站点上的所有Office产品都具有读/写支持:

In short, you can read and write MS Excel files using Java. 简而言之,您可以使用Java读写MS Excel文件。 In addition, you can read and write MS Word and MS PowerPoint files using Java. 此外,您可以使用Java读写MS Word和MS PowerPoint文件。

Used it a lot for Excel and very simple to pick up and use. 它在Excel中使用了很多,并且非常容易提取和使用。

Note ... the Apache POI library doesnt convert HTML to DOC(x) but it does allow you to write in the format - ie you would have to do the formatting yourself 注意... Apache POI库不会将HTML转换为DOC(x),但确实允许您以这种格式编写-即,您必须自己进行格式化

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM