java對比倆個(gè)word文件內(nèi)容差異
添加依賴:
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.doc.free</artifactId>
<version>3.9.0</version>
</dependency>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>http://repo./repository/maven-public/</url>
</repository>
//創(chuàng)建Document實(shí)例,,加載第一個(gè)Word示例文檔
Document doc1 = new Document();
doc1.loadFromFile("C:\\Users\\JWANG\\Desktop\\ror.docx");
//創(chuàng)建Document實(shí)例,,加載第二個(gè)Word示例文檔
Document doc2 = new Document();
doc2.loadFromFile("C:\\Users\\JWANG\\Desktop\\ror2.docx");
//比較兩個(gè)示例文檔的內(nèi)容差異
doc1.compare(doc2, "Host");
//保存結(jié)果文檔
doc1.saveToFile("C:\\Users\\JWANG\\Desktop\\Result.docx");