| | |
| | | private boolean demoEnabled; |
| | | |
| | | private static String profile; |
| | | private static String docx2pdf; |
| | | private static String docx2pdfPath; |
| | | |
| | | private static boolean addressEnabled; |
| | | private static String imagePath; |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | //手动替换输出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")); |