xuhy
2025-03-06 62733c3eadfc8400e60994d7d64fcb5b6a299531
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/PdfUtils.java
@@ -139,10 +139,17 @@
            }
            String absolutePath = pdfFile.getAbsolutePath();
            MultipartFile multipartFile = convertToMultipartFile(stream,fileName.substring(0,fileName.lastIndexOf(".")) );
            String s = tencentCosUtil.upLoadFile(multipartFile,"/wordToPdf");
            return s;
//            InputStream inputStream = new URL(url).openStream();
//            ByteArrayOutputStream stream = new ByteArrayOutputStream();
//            IConverter converter = LocalConverter.builder().build();
//            converter.convert(inputStream)
//                    .as(documentType)
//                    .to(stream)
//                    .as(DocumentType.PDF).execute();
//            MultipartFile multipartFile = convertToMultipartFile(stream,fileName.substring(0,fileName.lastIndexOf(".")) );
//            String s = tencentCosUtil.upLoadFile(multipartFile,"/wordToPdf");
//            return s;
            return "";
        } catch (Exception e) {
            throw new RuntimeException("PDF转换失败: " + e.getMessage(), e);