//去除Spire.Doc导出字样信息try (FileInputStream in = new FileInputStream(wordPath)){XWPFDocument docnew = new XWPFDocument(OPCPackage.open(in));Listparagraphs = docnew.getParagraphs();if (paragraphs.size() < 1){return true;}XWPFParagraph firstParagraph = paragraphs.get(0);if (firstParagraph.getText().contains("Spire.Doc")){docnew.removeBodyElement(docnew.getPosOfParagraph(firstParagraph));}OutputStream out = new FileOutputStream(wordPath);docnew.write(out);docnew.close();} catch (Exception e) {e.printStackTrace();}return true; }catch (Exception e){System.out.println("系统异常"+e.getMessage());e.printStackTrace();; }
上一篇: 教师节优美祝福语短信
下一篇:JAVASE(3.18)