|
|
@@ -40,6 +40,7 @@ import com.ruoyi.wisdomarbitrate.domain.*;
|
|
40
|
40
|
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
|
41
|
41
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
42
|
42
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
|
43
|
+import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
|
|
43
|
44
|
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
|
44
|
45
|
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
|
45
|
46
|
import com.tencentyun.TLSSigAPIv2;
|
|
|
@@ -50,6 +51,7 @@ import org.apache.http.entity.StringEntity;
|
|
50
|
51
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
51
|
52
|
import org.apache.http.impl.client.HttpClients;
|
|
52
|
53
|
import org.apache.http.util.EntityUtils;
|
|
|
54
|
+import org.apache.pdfbox.pdmodel.PDDocument;
|
|
53
|
55
|
import org.apache.poi.xwpf.usermodel.Document;
|
|
54
|
56
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
55
|
57
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -980,10 +982,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
980
|
982
|
if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
981
|
983
|
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
|
982
|
984
|
// 插入案件日志人员相关表
|
|
983
|
|
- if(CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
|
985
|
+ if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
984
|
986
|
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
|
|
985
|
987
|
// 插入日志附件表
|
|
986
|
|
- if(CollectionUtil.isNotEmpty(filterList)) {
|
|
|
988
|
+ if (CollectionUtil.isNotEmpty(filterList)) {
|
|
987
|
989
|
for (CaseAttach caseAttach : filterList) {
|
|
988
|
990
|
// 查询附件表
|
|
989
|
991
|
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
|
|
|
@@ -992,7 +994,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
992
|
994
|
}
|
|
993
|
995
|
}
|
|
994
|
996
|
|
|
995
|
|
- } caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
|
|
997
|
+ }
|
|
|
998
|
+ caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
|
996
|
999
|
}
|
|
997
|
1000
|
});
|
|
998
|
1001
|
|
|
|
@@ -1098,21 +1101,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1098
|
1101
|
}
|
|
1099
|
1102
|
List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
|
1100
|
1103
|
// 立案申请状态直接修改主表信息
|
|
1101
|
|
- if (caseAttachList != null && caseAttachList.size() > 0
|
|
1102
|
|
- && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
|
|
1103
|
|
- List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
|
|
1104
|
|
- if(CollectionUtil.isNotEmpty(filterList)){
|
|
1105
|
|
- // 先删除2的附件在新增
|
|
|
1104
|
+ if (caseAttachList != null && caseAttachList.size() > 0
|
|
|
1105
|
+ && caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
|
|
|
1106
|
+ List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
|
|
|
1107
|
+ if (CollectionUtil.isNotEmpty(filterList)) {
|
|
|
1108
|
+ // 先删除2的附件在新增
|
|
1106
|
1109
|
// caseAttachMapper.deleteByCasedIdAndType(caseApplication.getId(),2,0);
|
|
1107
|
1110
|
// for (CaseAttach caseAttach : filterList) {
|
|
1108
|
1111
|
// caseAttach.setCaseAppliId(caseApplication.getId());
|
|
1109
|
1112
|
// caseAttachMapper.save(caseAttach);
|
|
1110
|
1113
|
// }
|
|
1111
|
1114
|
|
|
1112
|
|
- for (CaseAttach caseAttach : caseAttachList) {
|
|
1113
|
|
- caseAttach.setCaseAppliId(caseApplication.getId());
|
|
1114
|
|
- caseAttachMapper.updateCaseAttach(caseAttach);
|
|
1115
|
|
- }
|
|
|
1115
|
+ for (CaseAttach caseAttach : caseAttachList) {
|
|
|
1116
|
+ caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
1117
|
+ caseAttachMapper.updateCaseAttach(caseAttach);
|
|
|
1118
|
+ }
|
|
1116
|
1119
|
}
|
|
1117
|
1120
|
|
|
1118
|
1121
|
|
|
|
@@ -1133,23 +1136,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1133
|
1136
|
try {
|
|
1134
|
1137
|
caseApplication.setCaseAppliId(caseApplication.getId());
|
|
1135
|
1138
|
int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
|
1136
|
|
- if (insertRow != 0 ) {
|
|
1137
|
|
- if( CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
|
1139
|
+ if (insertRow != 0) {
|
|
|
1140
|
+ if (CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
1138
|
1141
|
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
|
1139
|
1142
|
// 插入案件日志人员相关表
|
|
1140
|
1143
|
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
|
1141
|
1144
|
}
|
|
1142
|
|
- if(CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
|
1145
|
+ if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
1143
|
1146
|
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
|
|
1144
|
1147
|
// 插入日志附件表
|
|
1145
|
|
- if(CollectionUtil.isNotEmpty(filterList)) {
|
|
1146
|
|
- for (CaseAttach caseAttach : filterList) {
|
|
1147
|
|
- // 查询附件表
|
|
1148
|
|
- CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
|
|
1149
|
|
- attach.setCaseAppliLogId(caseApplication.getId());
|
|
1150
|
|
- caseAttachLogMapper.save(attach);
|
|
1151
|
|
- }
|
|
1152
|
|
- }
|
|
|
1148
|
+ if (CollectionUtil.isNotEmpty(filterList)) {
|
|
|
1149
|
+ for (CaseAttach caseAttach : filterList) {
|
|
|
1150
|
+ // 查询附件表
|
|
|
1151
|
+ CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
|
|
|
1152
|
+ attach.setCaseAppliLogId(caseApplication.getId());
|
|
|
1153
|
+ caseAttachLogMapper.save(attach);
|
|
|
1154
|
+ }
|
|
|
1155
|
+ }
|
|
1153
|
1156
|
|
|
1154
|
1157
|
}
|
|
1155
|
1158
|
}
|
|
|
@@ -2806,17 +2809,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2806
|
2809
|
if (CollectionUtil.isEmpty(reservedConferences)) {
|
|
2807
|
2810
|
return reservedConferences;
|
|
2808
|
2811
|
}
|
|
2809
|
|
- Map<Long,String> userIdMap = null;
|
|
|
2812
|
+ Map<Long, String> userIdMap = null;
|
|
2810
|
2813
|
List<Long> userIds = reservedConferences.stream().map(ReservedConference::getUserId).collect(Collectors.toList());
|
|
2811
|
|
- if(CollectionUtil.isNotEmpty(userIds)){
|
|
|
2814
|
+ if (CollectionUtil.isNotEmpty(userIds)) {
|
|
2812
|
2815
|
// 根据userids查询用户名
|
|
2813
|
2816
|
List<SysUser> userList = sysUserMapper.selectUserListByIds(userIds);
|
|
2814
|
|
- if(CollectionUtil.isNotEmpty(userList)){
|
|
2815
|
|
- userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId,SysUser::getUserName));
|
|
|
2817
|
+ if (CollectionUtil.isNotEmpty(userList)) {
|
|
|
2818
|
+ userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName));
|
|
2816
|
2819
|
}
|
|
2817
|
2820
|
}
|
|
2818
|
2821
|
for (ReservedConference reservedConference : reservedConferences) {
|
|
2819
|
|
- if(null!=reservedConference.getUserId() && null!=userIdMap){
|
|
|
2822
|
+ if (null != reservedConference.getUserId() && null != userIdMap) {
|
|
2820
|
2823
|
reservedConference.setUserName(userIdMap.get(reservedConference.getUserId()));
|
|
2821
|
2824
|
}
|
|
2822
|
2825
|
Date startTime = reservedConference.getScheduleStartTime();
|
|
|
@@ -2852,41 +2855,106 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2852
|
2855
|
if (file.isEmpty()) {
|
|
2853
|
2856
|
return AjaxResult.error("请选择要上传的文件");
|
|
2854
|
2857
|
}
|
|
2855
|
|
- //String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile";
|
|
2856
|
2858
|
UUID uuid = UUID.randomUUID();
|
|
2857
|
|
- String targetPath = "D:\\home\\unzip\\"+uuid+"\\";
|
|
|
2859
|
+ String targetPath = "\\home\\ruoyi\\uploadPath\\upload\\unzipFile\\";
|
|
|
2860
|
+ //String targetPath = "D:\\home\\unzip\\" + uuid + "\\";
|
|
2858
|
2861
|
File zipFile = null;
|
|
2859
|
2862
|
InputStream ins = null;
|
|
2860
|
2863
|
try {
|
|
2861
|
2864
|
ins = file.getInputStream();
|
|
2862
|
|
- String savePath = "D:\\develop\\java\\";
|
|
2863
|
|
- String saveName = uuid+file.getOriginalFilename();
|
|
2864
|
|
- zipFile = new File(savePath+saveName);
|
|
|
2865
|
+ //上传的压缩包保存的路径
|
|
|
2866
|
+ //String savePath = "D:\\develop\\java\\";
|
|
|
2867
|
+ String savePath = "\\home\\ruoyi\\uploadPath\\upload\\zipFile\\";
|
|
|
2868
|
+ String saveName = uuid + file.getOriginalFilename();
|
|
|
2869
|
+ zipFile = new File(savePath + saveName);
|
|
2865
|
2870
|
inputChangeToFile(ins, zipFile);
|
|
2866
|
2871
|
} catch (IOException e) {
|
|
2867
|
2872
|
e.printStackTrace();
|
|
2868
|
2873
|
}
|
|
2869
|
2874
|
//解压缩上传的压缩包
|
|
2870
|
|
- boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
|
|
2871
|
|
- if (unzipSuccess ) {
|
|
2872
|
|
- //去掉后缀名,拿到解压后的文件夹路径
|
|
2873
|
|
- String fileName = file.getOriginalFilename();
|
|
2874
|
|
- String nameWithoutExtension = fileName.substring(0, fileName.lastIndexOf("."));
|
|
|
2875
|
+ boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
|
|
|
2876
|
+ if (unzipSuccess) {
|
|
2875
|
2877
|
File directory = new File(targetPath);
|
|
2876
|
2878
|
List<String> andConvertPDF = findAndConvertPDF(directory);
|
|
2877
|
|
- if (andConvertPDF != null && andConvertPDF.size() > 0){
|
|
2878
|
|
- // 返回找到的PDF文件路径
|
|
2879
|
|
- return AjaxResult.success(andConvertPDF);
|
|
2880
|
|
- }else {
|
|
|
2879
|
+ if (andConvertPDF != null && andConvertPDF.size() > 0) {
|
|
|
2880
|
+ //遍历路径
|
|
|
2881
|
+ for (String pdfUrl : andConvertPDF) {
|
|
|
2882
|
+ //获取文件的页数
|
|
|
2883
|
+ int fileNumPage = getFileNumPage(pdfUrl);
|
|
|
2884
|
+ StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
|
|
|
2885
|
+ for (int i = 0; i < fileNumPage; i++) {
|
|
|
2886
|
+ //对接腾讯云接口.识别里面的数据
|
|
|
2887
|
+ //暂时写死
|
|
|
2888
|
+ String pdfFilePath = "http://121.40.189.20:9000/API/uploadPath/upload/2023/11/14/ca2ca4697e5449ff9b9d23f95b221f58.pdf";
|
|
|
2889
|
+ String text = OCRUtils.pdfIdentifyText(pdfUrl, i + 1);
|
|
|
2890
|
+ if (stringBuilder.length() > 0) {
|
|
|
2891
|
+ stringBuilder.append(","); // 在已有内容的情况下添加逗号分隔符
|
|
|
2892
|
+ }
|
|
|
2893
|
+ stringBuilder.append(text); // 拼接当前的字符串
|
|
|
2894
|
+ }
|
|
|
2895
|
+ // 将字符串按逗号分隔符切割
|
|
|
2896
|
+ String[] fields = stringBuilder.toString().split(",");
|
|
|
2897
|
+ JSONObject jsonObject = new JSONObject(); // 创建一个空的JSON对象
|
|
|
2898
|
+ for (String field : fields) {
|
|
|
2899
|
+ // 对于每个字段,再按冒号分隔符拆分出键和值
|
|
|
2900
|
+ String[] keyValue = field.split(":");
|
|
|
2901
|
+ if (keyValue.length == 2) { // 对于合法的键值对,将其添加到JSON对象中
|
|
|
2902
|
+ jsonObject.put(keyValue[0], keyValue[1]);
|
|
|
2903
|
+ }
|
|
|
2904
|
+ }
|
|
|
2905
|
+ //调用新增案件的接口
|
|
|
2906
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
2907
|
+
|
|
|
2908
|
+ caseApplication.setApplicationOrganId(jsonObject.getString("统一社会信用代码"));
|
|
|
2909
|
+ caseApplication.setCompLegalPerson(jsonObject.getString("法定代表人"));
|
|
|
2910
|
+ caseApplication.setResidenAffiliAppli(jsonObject.getString("住所"));
|
|
|
2911
|
+ caseApplication.setContactAddressAgent(jsonObject.getString("联系地址"));
|
|
|
2912
|
+ caseApplication.setNameAgent(jsonObject.getString("委托代理人"));
|
|
|
2913
|
+ caseApplication.setContactTelphoneAgent(jsonObject.getString("联系电话"));
|
|
|
2914
|
+ caseApplication.setDebtorName(jsonObject.getString("被申请人"));
|
|
|
2915
|
+ caseApplication.setDebtorIdentityNum(jsonObject.getString("居民身份证号码"));
|
|
|
2916
|
+ caseApplication.setArbitratClaims(jsonObject.getString("仲裁请求"));
|
|
|
2917
|
+ caseApplication.setCaseSubjectAmount(new BigDecimal(1));
|
|
|
2918
|
+ List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
|
|
2919
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
2920
|
+ caseAffiliate.setIdentityType(1);
|
|
|
2921
|
+ caseAffiliate.setName(jsonObject.getString("申请人"));
|
|
|
2922
|
+ caseAffiliate.setIdentityNum("");
|
|
|
2923
|
+ caseAffiliate.setContactTelphone(jsonObject.getString("申请人联系电话"));
|
|
|
2924
|
+ caseAffiliates.add(caseAffiliate);
|
|
|
2925
|
+ CaseAffiliate caseAffiliate1 = new CaseAffiliate();
|
|
|
2926
|
+ caseAffiliate1.setIdentityType(2);
|
|
|
2927
|
+ caseAffiliate1.setName(jsonObject.getString("被申请人"));
|
|
|
2928
|
+ caseAffiliate1.setIdentityNum("");
|
|
|
2929
|
+ caseAffiliate1.setContactTelphone(jsonObject.getString("被申请人联系电话"));
|
|
|
2930
|
+ caseAffiliates.add(caseAffiliate1);
|
|
|
2931
|
+ caseApplication.setCaseAffiliates(caseAffiliates);
|
|
|
2932
|
+ this.insertcaseApplication(caseApplication);
|
|
|
2933
|
+ if (null != caseApplication.getId()) {
|
|
|
2934
|
+ // 绑定案件与申请书
|
|
|
2935
|
+ File file1 = new File(pdfUrl);
|
|
|
2936
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
2937
|
+ caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
2938
|
+ String saveName = "/profile/upload/" + file1.getName();
|
|
|
2939
|
+ String savePath = "/home/ruoyi/uploadPath/upload";
|
|
|
2940
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
2941
|
+ caseAttach.setAnnexName(saveName);
|
|
|
2942
|
+ caseAttach.setAnnexType(1);
|
|
|
2943
|
+ caseAttachMapper.save(caseAttach);
|
|
|
2944
|
+ }
|
|
|
2945
|
+ }
|
|
|
2946
|
+ return AjaxResult.success("导入成功");
|
|
|
2947
|
+ } else {
|
|
2881
|
2948
|
// 没有找到符合条件的文件
|
|
2882
|
2949
|
return AjaxResult.error("未找到符合条件的文件");
|
|
2883
|
2950
|
}
|
|
2884
|
|
- }else {
|
|
|
2951
|
+ } else {
|
|
2885
|
2952
|
// 解压失败
|
|
2886
|
2953
|
return AjaxResult.error("解压失败");
|
|
2887
|
2954
|
}
|
|
2888
|
2955
|
|
|
2889
|
2956
|
}
|
|
|
2957
|
+
|
|
2890
|
2958
|
public static List<String> findAndConvertPDF(File directory) {
|
|
2891
|
2959
|
List<String> pdfPaths = new ArrayList<>();
|
|
2892
|
2960
|
if (directory.isFile()) {
|
|
|
@@ -2903,16 +2971,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2903
|
2971
|
path = pdfPath;
|
|
2904
|
2972
|
}
|
|
2905
|
2973
|
}
|
|
2906
|
|
- if (path!= null) {
|
|
|
2974
|
+ if (path != null) {
|
|
2907
|
2975
|
pdfPaths.add(path);
|
|
2908
|
2976
|
}
|
|
2909
|
2977
|
}
|
|
2910
|
2978
|
} else if (directory.isDirectory()) {
|
|
2911
|
2979
|
searchAndConvertPDF(directory, pdfPaths);
|
|
2912
|
|
- }else {
|
|
|
2980
|
+ } else {
|
|
2913
|
2981
|
return null;
|
|
2914
|
2982
|
}
|
|
2915
|
|
- return pdfPaths;
|
|
|
2983
|
+ return pdfPaths;
|
|
2916
|
2984
|
}
|
|
2917
|
2985
|
|
|
2918
|
2986
|
public static boolean isPDF(File file) {
|
|
|
@@ -2929,6 +2997,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2929
|
2997
|
return "";
|
|
2930
|
2998
|
}
|
|
2931
|
2999
|
}
|
|
|
3000
|
+
|
|
2932
|
3001
|
public static void searchAndConvertPDF(File directory, List<String> pdfPaths) {
|
|
2933
|
3002
|
File[] files = directory.listFiles();
|
|
2934
|
3003
|
if (files != null) {
|
|
|
@@ -2954,34 +3023,44 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2954
|
3023
|
}
|
|
2955
|
3024
|
}
|
|
2956
|
3025
|
}
|
|
|
3026
|
+
|
|
2957
|
3027
|
private static String convertToPDF(File file) {
|
|
2958
|
3028
|
String wordFilePath = file.getAbsolutePath();
|
|
2959
|
|
- String pdfSaveDirectory ="D:\\home\\unzip\\wordToPDF\\";
|
|
|
3029
|
+ // String pdfSaveDirectory = "D:\\home\\unzip\\wordToPDF\\";
|
|
|
3030
|
+ String pdfSaveDirectory = "\\home\\ruoyi\\uploadPath\\upload\\wordToPDF\\";
|
|
2960
|
3031
|
File directory = new File(pdfSaveDirectory);
|
|
2961
|
3032
|
if (!directory.exists()) {
|
|
2962
|
3033
|
directory.mkdirs();
|
|
2963
|
3034
|
}
|
|
2964
|
3035
|
String name = file.getName();
|
|
2965
|
3036
|
String nameWithoutExtension = name.substring(0, name.lastIndexOf("."));
|
|
2966
|
|
- String pdfFilePath =pdfSaveDirectory+nameWithoutExtension+".pdf";
|
|
|
3037
|
+ String pdfFilePath = pdfSaveDirectory + nameWithoutExtension + ".pdf";
|
|
2967
|
3038
|
File inputWord = new File(wordFilePath);
|
|
2968
|
3039
|
File outputFile = new File(pdfFilePath);
|
|
2969
|
|
- try {
|
|
|
3040
|
+ try {
|
|
2970
|
3041
|
InputStream docxInputStream = new FileInputStream(inputWord);
|
|
2971
|
3042
|
OutputStream outputStream = new FileOutputStream(outputFile);
|
|
2972
|
3043
|
IConverter converter = LocalConverter.builder().build();
|
|
2973
|
3044
|
converter.convert(docxInputStream).as(DocumentType.DOCX).to(outputStream).as(DocumentType.PDF).execute();
|
|
2974
|
3045
|
docxInputStream.close();
|
|
2975
|
3046
|
outputStream.close();
|
|
2976
|
|
- System.out.println("success");
|
|
2977
|
|
- File file1= new File(pdfFilePath);
|
|
2978
|
|
- System.out.println("这是转化后的PDF文件路径"+file1);
|
|
2979
|
3047
|
|
|
2980
|
3048
|
} catch (Exception e) {
|
|
2981
|
3049
|
e.printStackTrace();
|
|
2982
|
3050
|
}
|
|
2983
|
3051
|
return pdfFilePath;
|
|
2984
|
3052
|
}
|
|
|
3053
|
+
|
|
|
3054
|
+ private static int getFileNumPage(String pdfUrl) {
|
|
|
3055
|
+ File pdfFile = new File(pdfUrl);
|
|
|
3056
|
+ int pageCount = 0;
|
|
|
3057
|
+ try (PDDocument document = PDDocument.load(pdfFile)) {
|
|
|
3058
|
+ pageCount = document.getNumberOfPages();
|
|
|
3059
|
+ } catch (IOException e) {
|
|
|
3060
|
+ e.printStackTrace();
|
|
|
3061
|
+ }
|
|
|
3062
|
+ return pageCount;
|
|
|
3063
|
+ }
|
|
2985
|
3064
|
}
|
|
2986
|
3065
|
|
|
2987
|
3066
|
|