Spire.doc收费版是没有500行限制的有四种方式:
1. 花钱搞定 直接购买官方版本
2. 网上找一些破解版。(涉嫌侵权)
3.Spire.doc.free 版本、限制500行。
4. 使用如下代码,先试用Spire.doc生成文档,文档头部会有提示:
Evaluation Warning: The document was created with Spire.Doc for JAVA.
使用如下代码去除:
//去水印
public static void restWord(String docFilePath) {
try (FileInputStream in = new FileInputStream(docFilePath)) {
XWPFDocument doc = new XWPFDocument(OPCPackage.open(in));
List<XWPFParagraph> paragraphs = doc.getParagraphs();
if (paragraphs.size() < 1) return;
XWPFParagraph firstParagraph = paragraphs.get(0);
if (firstParagraph.getText().contains("Spire.Doc")) {
doc.removeBodyElement(doc.getPosOfParagraph(firstParagraph));
}
OutputStream out = new FileOutputStream(docFilePath);
doc.write(out);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
文章讨论了Spire.doc收费版无500行限制的四种方法,包括直接购买、寻找破解版、使用免费版及通过代码移除水印。提供了Java代码示例来消除文档中的评估警告水印。
1131





