|
|
@ -1,6 +1,5 @@ |
|
|
|
package org.jeecg.modules.word; |
|
|
|
package org.jeecg.modules.word; |
|
|
|
|
|
|
|
|
|
|
|
import cn.afterturn.easypoi.entity.ImageEntity; |
|
|
|
|
|
|
|
import cn.afterturn.easypoi.word.WordExportUtil; |
|
|
|
import cn.afterturn.easypoi.word.WordExportUtil; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
@ -87,12 +86,19 @@ public class WordExportUtil_test { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void test3() { |
|
|
|
public void test3() { |
|
|
|
String wordPath = "C:\\Users\\YX\\Documents\\00.docx"; |
|
|
|
String wordPath = "C:\\Users\\YX\\Documents\\2025黄淮学院工程技术研究中心1121.docx"; |
|
|
|
String padPath = "C:\\Users\\YX\\Documents\\00.pdf"; |
|
|
|
String wordPath2 = "C:\\Users\\YX\\Documents\\copy1121.docx"; |
|
|
|
|
|
|
|
// String wordPath2 = "D:\\model4word\\pdf\\2025黄淮学院工程技术研究中心1121.docx";
|
|
|
|
|
|
|
|
// String wordPath2 = "C:\\Users\\YX\\Documents\\00.docx";
|
|
|
|
|
|
|
|
String padPath = "C:\\Users\\YX\\Documents\\1_1.pdf"; |
|
|
|
|
|
|
|
String padPath2 = "C:\\Users\\YX\\Documents\\1_2.pdf"; |
|
|
|
|
|
|
|
// String padPath2 = "C:\\Users\\YX\\Documents\\00.pdf";
|
|
|
|
|
|
|
|
|
|
|
|
// FileUtils.convertDocx2Pdf(wordPath, file + File.separator + padFileName);
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
FileUtils.convertDocxToPdf(wordPath, padPath); |
|
|
|
// FileUtils.convertDocxToPdf(wordPath, padPath);
|
|
|
|
|
|
|
|
FileUtils.convertDocx2Pdf(wordPath, padPath); |
|
|
|
|
|
|
|
FileUtils.convertDocx2Pdf(wordPath2, padPath2); |
|
|
|
|
|
|
|
// FileUtils.convertDocx2Pdf(wordPath, padPath2);
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|