1.问题
在使用Spire.Doc的word文档产生了警告水印
(Evaluation Warning: The document was created with Spire.Doc for JAVA.)
2.解决方式
word格式主要有2003 doc格式和2007docx格式,针对不同的格式采用不同的方法。
import com.spire.doc.Document;
import com.spire.doc.FileFormat;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.io.*;
public class test {
public static void main(String args[]) throws IOException {
RemoveTag("C:\\Users\\QYF\\Desktop\\测试去水印.docx");
RemoveTag("C:\\Users\\QYF\\Desktop\\测试去水印.doc");
}
public static void RemoveTag(String file_path) throws IOException {
InputStream inputStream=null;
String out_path="C:\\Users\\MYH\\Desktop";
//加载Word文档
Document document = new Doc