java spire.doc html转word 头部总是有Evaluation Warning: The document was created with Spire.Doc for JAVA
需要的包有
org.apache.poi
poi-ooxml
4.1.2
代码操作
public static void main(String[] args) {
File file = new File(“C:\Users\Administrator\Desktop\a\cxml.doc”);
String path = “C:\Users\Administrator\Desktop\a\dxml.doc”;
cleanLicenseFlag(file,path);
}
public static void cleanLicenseFlag(File file,String path) {
try {
XWPFDocument doc = new XWPFDocument(new FileInputStream(file.getPath()));
doc.removeBodyElement(0);
doc.write(new FileOutputStream(path));
doc.close();
} catch (IOException e) {
e.printStackTrace();
}
}