|
|
@ -78,6 +78,7 @@ public class BaseUtil { |
|
|
|
BaseUtil.exportWord(res, wordPath); |
|
|
|
BaseUtil.exportWord(res, wordPath); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("文件导出异常: {}", e.getMessage()); |
|
|
|
log.error("文件导出异常: {}", e.getMessage()); |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
AsposeUtil.wordToPdf(wordPath, pdfPath); |
|
|
|
AsposeUtil.wordToPdf(wordPath, pdfPath); |
|
|
|
BaseUtil.readPdf(response,pdfPath); |
|
|
|
BaseUtil.readPdf(response,pdfPath); |
|
|
@ -138,6 +139,7 @@ public class BaseUtil { |
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i); |
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i); |
|
|
|
String name = jsonObject.getString("name"); |
|
|
|
String name = jsonObject.getString("name"); |
|
|
|
String url = jsonObject.getString("url"); |
|
|
|
String url = jsonObject.getString("url"); |
|
|
|
|
|
|
|
url = URLEncoder.encode(url, "UTF-8"); |
|
|
|
String id = paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId(); |
|
|
|
String id = paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId(); |
|
|
|
CTHyperlink cLink = paragraph.getCTP().addNewHyperlink(); |
|
|
|
CTHyperlink cLink = paragraph.getCTP().addNewHyperlink(); |
|
|
|
cLink.setId(id); |
|
|
|
cLink.setId(id); |
|
|
@ -146,7 +148,7 @@ public class BaseUtil { |
|
|
|
CTR ctr = CTR.Factory.newInstance(); |
|
|
|
CTR ctr = CTR.Factory.newInstance(); |
|
|
|
ctr.setTArray(new CTText[]{ctText}); |
|
|
|
ctr.setTArray(new CTText[]{ctText}); |
|
|
|
cLink.setRArray(new CTR[]{ctr}); |
|
|
|
cLink.setRArray(new CTR[]{ctr}); |
|
|
|
if(i<jsonArray.length()-1) { |
|
|
|
if (i<jsonArray.length()-1) { |
|
|
|
paragraph.createRun().addBreak(); |
|
|
|
paragraph.createRun().addBreak(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|