|
@@ -92,7 +92,8 @@ public class App extends Application {
|
|
|
/**
|
|
/**
|
|
|
* 代码快初始化匹配金额的正则表达式对象
|
|
* 代码快初始化匹配金额的正则表达式对象
|
|
|
*/
|
|
*/
|
|
|
- String regex = "理赔金额合计:¥(?<money>\\d+\\.\\d{2})";
|
|
|
|
|
|
|
+ //String regex = "理赔金额合计:¥(?<money>\\d+\\.\\d{2})";
|
|
|
|
|
+ String regex = "理赔金额合计[^\\d]{1,2}[¥¥](?<money>\\d+\\.\\d{2})";
|
|
|
this.pattern = Pattern.compile(regex);
|
|
this.pattern = Pattern.compile(regex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -358,6 +359,7 @@ public class App extends Application {
|
|
|
PDFTextStripper textStripper = new PDFTextStripper();
|
|
PDFTextStripper textStripper = new PDFTextStripper();
|
|
|
//提取文本
|
|
//提取文本
|
|
|
text = textStripper.getText(pdDocument);
|
|
text = textStripper.getText(pdDocument);
|
|
|
|
|
+ System.out.println("text = " + text);
|
|
|
//解析金额
|
|
//解析金额
|
|
|
Matcher matcher = pattern.matcher(text);
|
|
Matcher matcher = pattern.matcher(text);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|