beetlsql3-dev
Mlxa0324 2 years ago
parent 2f15b89342
commit 4788be57af

@ -96,12 +96,16 @@ public class TempFileController {
*/
private void tryConvertPDF(FileEntity fileEntity) throws FileNotFoundException {
if (null != fileEntity) {
// 相对路径
String absoluteUrl = fileEntity.getAbsoluteUrl();
BufferedInputStream inputStream = FileUtil.getInputStream(absoluteUrl);
// 同名文件多生成一个pdf文件
String pdfName = absoluteUrl.replaceAll("\\.[^\\.]+", ".pdf");
FileOutputStream outputStream = new FileOutputStream(pdfName);
// 根据类型来转换成为pdf
boolean convertedSuccess = PDFConverUtil.convertToPDFByFileNameSuffix(absoluteUrl, inputStream, outputStream);
if(convertedSuccess) {
// 转换成功,则返回给前端
fileEntity.set("cvPDFAbsoluteUrl", pdfName);
}
}

Loading…
Cancel
Save