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(); } }