为有中文需求的客户提供多渠道中文技术支持.

Fri Mar 08, 2024 9:37 am

spire.office9.1.10
JDK1.8
进行word文档对比:

代码:
//载入原文档和修改后的文档
original.loadFromFile("模板合同.docx");
revised.loadFromFile("客户合同.docx");
CompareOptions options = new CompareOptions();
options.setTextCompareLevel(TextDiffMode.Char);
//比较两个文档
original.compare(revised, "user", new Date(), options);
//保存比较结果
original.saveToFile("对比结果.docx");

代码报错:
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float
at com.spire.doc.packages.sprjdv.spr†※—(Unknown Source)
at com.spire.doc.packages.sprobw.spr‘∬—(Unknown Source)
at com.spire.doc.packages.sprobw.spr▎∬—(Unknown Source)
at com.spire.doc.packages.sprwnv.spr╻⁆—(Unknown Source)
at com.spire.doc.packages.sprwnv.spr┟▒(Unknown Source)
at com.spire.doc.documents.Paragraph.spr㈮⃞□(Unknown Source)
at com.spire.doc.DocumentObject.spr‰◐(Unknown Source)
at com.spire.doc.documents.Paragraph.spr╹◑(Unknown Source)
at com.spire.doc.DocumentObject.spr‣◑(Unknown Source)
at com.spire.doc.DocumentObject.spr‰◐(Unknown Source)
at com.spire.doc.Body.spr╹◑(Unknown Source)
at com.spire.doc.packages.sprwnv.spr┠⇇—(Unknown Source)
at com.spire.doc.packages.sprpiv.spr≂⁆—(Unknown Source)
at com.spire.doc.packages.sprpiv.spr—⇇—(Unknown Source)
at com.spire.doc.packages.sprwnv.spr∭┏(Unknown Source)
at com.spire.doc.packages.spriov.spr≂⁆—(Unknown Source)
at com.spire.doc.packages.spriov.spr®‘(Unknown Source)
at com.spire.doc.packages.spriov.spr⑊⇇—(Unknown Source)
at com.spire.doc.packages.spriov.spr¬⇇—(Unknown Source)
at com.spire.doc.Document.spr↮┐—(Unknown Source)
at com.spire.doc.Document.saveToFile(Unknown Source)
at com.spire.doc.Document.saveToFile(Unknown Source)
at org.example.Main.main(Main.java:36)

chencaining
 
Posts: 1
Joined: Fri Mar 08, 2024 9:27 am

Mon Mar 11, 2024 2:17 am

您好,

感谢您的咨询。
为了便于我们进一步调查您的问题,请将您的测试文档上传到附件或者发送至邮件(support@e-iceblue.com)。提前感谢。

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 454
Joined: Mon Dec 27, 2021 2:23 am

Fri May 31, 2024 9:02 am

您好,

感谢您的耐心等待,我们最新发布的 Spire.Doc for Java版本: 12.5.1(https://www.e-iceblue.cn/Downloads/Spire-Doc-JAVA.html)修复了您提到的比较Word文档程序报错的问题。请更新测试。

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 454
Joined: Mon Dec 27, 2021 2:23 am

Return to 中文技术支持