In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Java how to turn Word into HTML, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
[program environment]
1. IntelliJ IDEA 2018 (jdk 1.8.0)
two。 Test documentation: Word 2013 (.docx)
3. Jar package: Free Spire.Doc for Java 3.9.0
There are two ways to import jar:
Method 1: download the jar package locally, decompress it, and import the Spire.Doc.jar under the local lib folder into the Java program, as follows:
Import results:
Methods in the 2:maven program, you need to configure the pom.xml file and specify the maven repository path and the dependency of spire.doc.free. The configuration content is as follows:
Com.e-iceblue http://repo.e-iceblue.cn/repository/maven-public/ e-iceblue spire.doc.free 3.9.0
[Java]
Import com.spire.doc.*;public class WordtoHtml {public static void main (String [] args) {Document doc = new Document (); doc.loadFromFile ("test.docx"); doc.saveToFile ("wordtohtml.html", FileFormat.Html); doc.dispose ();}} conversion effect
Word test documentation:
Converted HTML file:
Note: the file path in the code is the IDEA program project folder path, such as F:\ IDEAProject\ Conversion_Doc\ test.docx, and the file path can be customized to another path.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.