[测评系统]--测评系统核心代码库
林致杰
2023-10-19 644fc2c4817d759195c016bcac80f43ec6540dfc
bugfix
2个文件已修改
19 ■■■■■ 已修改文件
src/main/java/com/ots/framework/config/EssConfig.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ots/project/tool/PdfUtil.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ots/framework/config/EssConfig.java
@@ -15,7 +15,7 @@
    private boolean demoEnabled;
    
    private static String profile;
    private static String docx2pdf;
    private static String docx2pdfPath;
    
    private static boolean addressEnabled;
    private static String imagePath;
@@ -93,11 +93,11 @@
        return getProfile() + "/images";
    }
    public static String getDocx2pdf() {
        return docx2pdf;
    public static String getDocx2pdfPath() {
        return docx2pdfPath;
    }
    public static void setDocx2pdf(String docx2pdf) {
        EssConfig.docx2pdf = docx2pdf;
    public static void setDocx2pdfPath(String docx2pdfPath) {
        EssConfig.docx2pdfPath = docx2pdfPath;
    }
}
src/main/java/com/ots/project/tool/PdfUtil.java
@@ -58,7 +58,14 @@
            }
            //手动替换输出pdf名称
            String output = filePath.replaceAll(".docx", ".pdf");
            String[] args1 = new String[] { "python3", pythonScript, filePath, output };
            String os = System.getProperty("os.name");
            String[] args1;
            if (os.contains("Windows")){
                args1 = new String[] { "python", pythonScript, filePath, output };
            } else {
                args1 = new String[] { "python3", pythonScript, filePath, output };
            }
            // 执行py文件
            Process proc = Runtime.getRuntime().exec(args1);
            BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream(), "GBK"));