当使用Spire的产品的时候 会有头部的水印 :
The document was created with Spire.PDF for Java
/**
* 去除第一行水印
* @param filePath 原路径
* @param filePathS 新路径
*/
public void fileZh(String filePath,String filePathS) throws IOException {
//将文档输入input流
InputStream is = new FileInputStream(filePath);
XWPFDocument document = new XWPFDocument(is);
//Spire的产品 生成的文件会自带同步警告信息,这里来删除Spire产品的的警告信息
document.removeBodyElement(0);
//将文件流put到新的文件中
OutputStream os=new FileOutputStream(filePathS);
try {
document.write(os);
log.info("水印去除完成,文档生成成功");
} catch (Exception e) {
e.printStackTrace();
}
}