依赖
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>14.7.0</version>
</dependency>
//目前是处理word
InputStream inputStream = fileServerService.download(path);
Document document = null;
try {
document = new Document(inputStream);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
// 保存pdf格式
document.save(bos, SaveFormat.PDF);
String pdfPath = fileServerService.uploadFile(new ByteArrayInputStream(bos.toByteArray()), fileName + ".pdf");
// 保存文书
return pdfPath;
} catch (Exception e) {
throw new HisignException("打印失败");
}