docx转为PDF的方法代码如下:
Document document = new Document(file.getInputStream());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
document.save(outputStream, SaveFormat.PDF);
Files.write(Paths.get("/Users/p…...setAllowAutoFit(true); } } for (Section section : docxDocument.getSections())...ParagraphCollection paragraphs = section.getBody().getParagraphs();...