|
@@ -46,6 +46,8 @@ public class ExportPaperUtil {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(ExportPaperUtil.class);
|
|
|
|
|
|
+ private static final String docxBasePath=FileDisposeUtil.getDocxBasePath();
|
|
|
+
|
|
|
private static final int docImageSzie=12700;
|
|
|
|
|
|
private static final String DOCX_SUFFIX = ".docx";
|
|
@@ -104,7 +106,7 @@ public class ExportPaperUtil {
|
|
|
//考试说明word文件
|
|
|
public static File createExamRemarkDocFile(File directory,String fileName,String html) throws IOException {
|
|
|
// doc固定源文件目录
|
|
|
- File docxDir = new File(getDocxBasePath());
|
|
|
+ File docxDir = new File(docxBasePath);
|
|
|
// 将要生成的doc源文件目录
|
|
|
File docxTargetDir = new File(directory.getAbsolutePath() + "/docx/");
|
|
|
docxTargetDir.mkdir();
|
|
@@ -288,7 +290,7 @@ public class ExportPaperUtil {
|
|
|
// 原始试卷
|
|
|
public static File createOriginPaperDocFile(PaperExp paperExp, File directory) throws Exception {
|
|
|
// doc固定源文件目录
|
|
|
- File docxDir = new File(getDocxBasePath());
|
|
|
+ File docxDir = new File(docxBasePath);
|
|
|
// 将要生成的doc源文件目录
|
|
|
File docxTargetDir = new File(directory.getAbsolutePath() + "/docx/");
|
|
|
docxTargetDir.mkdir();
|
|
@@ -310,10 +312,6 @@ public class ExportPaperUtil {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private static String getDocxBasePath() {
|
|
|
- return JsonImportUtil.class.getProtectionDomain().getCodeSource().getLocation().getPath()
|
|
|
- + "export_template/docx";
|
|
|
- }
|
|
|
|
|
|
private static List<JSection> getSections(String html) {
|
|
|
return getSections(html, false);
|