|
@@ -202,6 +202,15 @@ public class PDFTableReader<T> {
|
|
|
return pdfTable;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 按照需要摘取的内容的标题、需要摘取的内容的后标识、需要摘取的内容的结束行来标识需要摘取的内容
|
|
|
+ * @param pdfTable 已处理过的pdf内容
|
|
|
+ * @param title 需要摘取的内容的标题(例:name:xxx,填name:) 相当于内容的前X,不可为空
|
|
|
+ * @param afterTitle 需要摘取的内容的后标识(例:name:xxx title,填title)相当于内容的后X,可为空,可不在内容行中,为空时数据可一直获取到该行的末尾
|
|
|
+ * @param nextTitle 结束行,多行情况下使用,会根据此行y值、title的x值和y值、afterTitle的x值来确定区域,获取此区域中的所有数据,可为空,为空只获取一行
|
|
|
+ * @param ignoreRow 忽略行,不获取此行数据
|
|
|
+ * @return 将区域中的数据直接打成字符串返回
|
|
|
+ */
|
|
|
public static String getLineByTitle(PdfTable pdfTable, String title, String afterTitle, String nextTitle, List<String> ignoreRow) {
|
|
|
Map<Float, PdfRow> pdfRows = pdfTable.getPdfRows();
|
|
|
Float titleRow = null;
|
|
@@ -243,6 +252,7 @@ public class PDFTableReader<T> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(titleRow == null) return new String();
|
|
|
//根据titleRow和nextRow获取多行数据
|
|
|
List<Float> collect = new ArrayList<>();
|
|
|
if (nextRow != null) {
|
|
@@ -278,6 +288,15 @@ public class PDFTableReader<T> {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 按照需要摘取的内容的标题、需要摘取的内容的后标识、需要摘取的内容的结束行来标识需要摘取的内容
|
|
|
+ * @param pdfTable 已处理过的pdf内容
|
|
|
+ * @param title 需要摘取的内容的标题(例:name:xxx,填name:) 相当于内容的前X,不可为空
|
|
|
+ * @param afterTitle 需要摘取的内容的后标识(例:name:xxx title,填title)相当于内容的后X,可为空,为空时数据可一直获取到该行的末尾
|
|
|
+ * @param nextTitle 结束行,多行情况下使用,会根据此行y值、title的x值和y值、afterTitle的x值来确定区域,获取此区域中的所有数据,可为空,为空只获取一行
|
|
|
+ * @param ignoreRow 忽略行,不获取此行数据
|
|
|
+ * @return 返回区域中的所有行,待处理
|
|
|
+ */
|
|
|
public static List<PdfCell> getRowsByTitle(PdfTable pdfTable, String title, String afterTitle, String nextTitle, List<String> ignoreRow) {
|
|
|
Map<Float, PdfRow> pdfRows = pdfTable.getPdfRows();
|
|
|
Float titleRow = null;
|
|
@@ -393,7 +412,9 @@ public class PDFTableReader<T> {
|
|
|
|
|
|
for (Float key : sortKeys) {
|
|
|
if (pdfRows.get(key) != null) {
|
|
|
- resultRows.put(key, pdfRows.get(key));
|
|
|
+ PdfRow pdfRow = pdfRows.get(key);
|
|
|
+ pdfRow.setRowY(key);
|
|
|
+ resultRows.put(key, pdfRow);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -499,7 +520,6 @@ public class PDFTableReader<T> {
|
|
|
headerRow.setCell(headerCells);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
int index = 0;
|
|
|
for (PdfCell cell : headerRow.getCell()) {
|
|
|
//设置第一个表头宽度
|
|
@@ -534,7 +554,6 @@ public class PDFTableReader<T> {
|
|
|
}
|
|
|
|
|
|
//获取数据
|
|
|
-
|
|
|
JSONArray result = new JSONArray();
|
|
|
Map<Float, JSONObject> dataObject = new HashMap<>();
|
|
|
List<PdfRow> tableDataRows = new ArrayList<>();
|
|
@@ -562,11 +581,6 @@ public class PDFTableReader<T> {
|
|
|
}
|
|
|
headerIndex++;
|
|
|
}
|
|
|
- for (String extra : extraFields) {
|
|
|
- if (dataCell.getText().contains(extra)) {
|
|
|
- extraRow = true;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|
|
@@ -597,7 +611,7 @@ public class PDFTableReader<T> {
|
|
|
|
|
|
continue;
|
|
|
}
|
|
|
- if ("extra".equals(row.getRowType())) {
|
|
|
+ if ("extra".equals(row.getRowType()) || "header".equals(row.getRowType()) || "border".equals(row.getRowType())) {
|
|
|
needSupple = false;
|
|
|
continue;
|
|
|
}
|
|
@@ -629,6 +643,341 @@ public class PDFTableReader<T> {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public static JSONArray getAlignCenterPdfTable(PdfTable pdfTable, List<String> fields, List<String> otherFields, List<String> ignoreFields, String[] extraFields, String headerKey, String endKey, String headerAlignment, Boolean isMultiHeader) {
|
|
|
+ //根据抬头和结束行标记表格整体高度
|
|
|
+ Map<Float, PdfRow> pdfRows = pdfTable.getPdfRows();
|
|
|
+ Set<Float> keys = pdfRows.keySet();
|
|
|
+ List<Float> sortKeys = keys.stream().sorted().collect(Collectors.toList());
|
|
|
+ List<Float> ignoreRows = new ArrayList<>();
|
|
|
+ List<PdfRow> tableRows = new ArrayList<>();
|
|
|
+ PdfRow headerRow = new PdfRow();
|
|
|
+ Float tableStartY = null;
|
|
|
+ Float tableEndY = null;
|
|
|
+ for (Float key : sortKeys) {
|
|
|
+ PdfRow pdfRow = pdfRows.get(key);
|
|
|
+ if (pdfRow == null) continue;
|
|
|
+ List<PdfCell> cells = pdfRow.getCell();
|
|
|
+ for (PdfCell cell : cells) {
|
|
|
+ for (String field : ignoreFields) {
|
|
|
+ if (cell.getText().contains(field)) {
|
|
|
+ ignoreRows.add(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (cell.getText().contains(headerKey) && tableStartY == null) {
|
|
|
+ tableStartY = key;
|
|
|
+ headerRow = pdfRow;
|
|
|
+ }
|
|
|
+ if (cell.getText().contains(endKey) && tableStartY != null) {
|
|
|
+ tableEndY = key;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (tableStartY != null && tableEndY == null) {
|
|
|
+ tableRows.add(pdfRow);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //针对于表格标题行多行情况,按标记取出标准标题行,行数据不完整时,在此处补全
|
|
|
+ Float headerRowLowY = tableStartY;
|
|
|
+ Float headerRowHighY = tableStartY;
|
|
|
+
|
|
|
+
|
|
|
+ if (isMultiHeader) {
|
|
|
+ int middleIndex = sortKeys.indexOf(tableStartY);
|
|
|
+ PdfRow preHeaderRow = new PdfRow();
|
|
|
+ PdfRow afterHeaderRow = new PdfRow();
|
|
|
+ if (tableStartY - sortKeys.get(middleIndex - 1) <= 12) {
|
|
|
+ preHeaderRow = pdfRows.get(sortKeys.get(middleIndex - 1));
|
|
|
+ pdfRows.put(sortKeys.get(middleIndex - 1), null);
|
|
|
+ }
|
|
|
+ if (sortKeys.get(middleIndex + 1) - tableStartY <= 12) {
|
|
|
+ afterHeaderRow = pdfRows.get(sortKeys.get(middleIndex + 1));
|
|
|
+ pdfRows.put(sortKeys.get(middleIndex + 1), null);
|
|
|
+ }
|
|
|
+ //合并表头
|
|
|
+ if (preHeaderRow.getCell() != null) {
|
|
|
+ headerRow.getCell().addAll(preHeaderRow.getCell());
|
|
|
+ }
|
|
|
+ if (afterHeaderRow.getCell() != null) {
|
|
|
+ headerRow.getCell().addAll(afterHeaderRow.getCell());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PdfCell> headerCells = new ArrayList<>();
|
|
|
+ List<PdfCell> cells = headerRow.getCell().stream().sorted(new Comparator<PdfCell>() {
|
|
|
+ @Override
|
|
|
+ public int compare(PdfCell o1, PdfCell o2) {
|
|
|
+ if (o1.getCellStartX() == o2.getCellStartX()) {
|
|
|
+ return (int) (o1.getCellY() - o2.getCellY());
|
|
|
+ }
|
|
|
+ return (int) (o1.getCellStartX() - o2.getCellStartX());
|
|
|
+ }
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (int index = 0; index < cells.size() - 1; index++) {
|
|
|
+ Boolean isMerge = false;
|
|
|
+ //比较两个单元格是否存在包含或被包含关系,存在就合并这两个单元格
|
|
|
+ PdfCell resultCell = new PdfCell();
|
|
|
+ PdfCell preCell = cells.get(index);
|
|
|
+ PdfCell afterCell = cells.get(index + 1);
|
|
|
+ if (preCell.getCellStartX() <= afterCell.getCellStartX() && preCell.getCellEndX() >= afterCell.getCellEndX()) {
|
|
|
+ isMerge = true;
|
|
|
+ } else if (afterCell.getCellStartX() <= preCell.getCellStartX() && afterCell.getCellEndX() >= preCell.getCellEndX()) {
|
|
|
+ isMerge = true;
|
|
|
+ }
|
|
|
+ if (isMerge) {
|
|
|
+ resultCell.setCellStartX(preCell.getCellStartX() < afterCell.getCellStartX() ? preCell.getCellStartX() : afterCell.getCellStartX());
|
|
|
+ resultCell.setCellEndX(preCell.getCellEndX() < afterCell.getCellEndX() ? afterCell.getCellEndX() : preCell.getCellEndX());
|
|
|
+ resultCell.setText(preCell.getText() + " " + afterCell.getText());
|
|
|
+ resultCell.setCellY(preCell.getCellY());
|
|
|
+ List<PdfTextPosition> positions = preCell.getPositions();
|
|
|
+ positions.addAll(afterCell.getPositions());
|
|
|
+ resultCell.setPositions(positions);
|
|
|
+ headerCells.add(resultCell);
|
|
|
+ index++;
|
|
|
+ if(preCell.getCellY() < headerRowHighY) {
|
|
|
+ headerRowHighY = preCell.getCellY();
|
|
|
+ }
|
|
|
+ if(afterCell.getCellY() > headerRowLowY) {
|
|
|
+ headerRowLowY = afterCell.getCellY();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ headerCells.add(preCell);
|
|
|
+ if (index == cells.size() - 2) {
|
|
|
+ headerCells.add(afterCell);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ headerRow.setCell(headerCells);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(headerRow.getCell().size() != fields.size()) {
|
|
|
+ fields = otherFields;
|
|
|
+ }
|
|
|
+
|
|
|
+ int index = 0;
|
|
|
+ for (PdfCell cell : headerRow.getCell()) {
|
|
|
+ //设置第一个表头宽度
|
|
|
+ if (index == 0) {
|
|
|
+ if (headerAlignment.equals("mediate")) {
|
|
|
+ float space = cell.getCellStartX() - pdfTable.getStandardPosition() + 1;
|
|
|
+ cell.setCellStartX(pdfTable.getStandardPosition());
|
|
|
+ //单元格结束x值为起始x值 - 偏移量 + 结束x值
|
|
|
+ cell.setCellEndX(cell.getCellEndX() + space);
|
|
|
+ } else if (headerAlignment.equals("left")) {
|
|
|
+ cell.setCellStartX(0);
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ } else {
|
|
|
+ if (headerAlignment.equals("mediate")) {
|
|
|
+ //获取前一个单元格
|
|
|
+ PdfCell prePdfCell = headerRow.getCell().get(index - 1);
|
|
|
+ float space = cell.getCellStartX() - prePdfCell.getCellEndX();
|
|
|
+ cell.setCellStartX(prePdfCell.getCellEndX());
|
|
|
+ cell.setCellEndX(cell.getCellEndX() + space);
|
|
|
+ } else if (headerAlignment.equals("left")) {
|
|
|
+ //获取前一个单元格
|
|
|
+ PdfCell prePdfCell = headerRow.getCell().get(index - 1);
|
|
|
+ //设置前一个单元格的endx值为当前单元格的startx
|
|
|
+ prePdfCell.setCellEndX(cell.getCellStartX());
|
|
|
+ if (cell.getText().equals(fields.get(fields.size() - 1))) {
|
|
|
+ cell.setCellEndX(pdfTable.getWidth());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Float preBorderY = headerRowLowY;
|
|
|
+ //获取数据
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+ Map<Float, JSONObject> dataObject = new HashMap<>();
|
|
|
+ List<PdfRow> tableDataRows = new ArrayList<>();
|
|
|
+ if (tableEndY == null) {
|
|
|
+ tableEndY = pdfTable.getHeight() * pdfTable.getPageNums();
|
|
|
+ }
|
|
|
+ index = 0;
|
|
|
+ for (Float key : sortKeys) {
|
|
|
+ if (key > tableStartY && key < tableEndY && !ignoreRows.contains(key)) {
|
|
|
+ Boolean isDataRow = false;//数据行标记
|
|
|
+ Boolean isExtraRow = false;//额外行标记
|
|
|
+ Boolean isHeaderRow = false;//标题行标记
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ PdfRow pdfRow = pdfRows.get(key);
|
|
|
+ if(pdfRow == null) {
|
|
|
+ index ++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<PdfCell> dataCells = pdfRow.getCell();
|
|
|
+
|
|
|
+ for (PdfCell dataCell : dataCells) {
|
|
|
+ int headerIndex = 0;
|
|
|
+ for (String extra : extraFields) {
|
|
|
+ if (dataCell.getText().contains(extra)) {
|
|
|
+ isExtraRow = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(dataCell.getText().contains(headerKey)) {
|
|
|
+ isHeaderRow = true;
|
|
|
+ isDataRow = false;
|
|
|
+ }
|
|
|
+ for (PdfCell cell : headerRow.getCell()) {
|
|
|
+ if (dataCell.getCellStartX() >= cell.getCellStartX() && dataCell.getCellEndX() <= cell.getCellEndX()) {
|
|
|
+ if (headerIndex == 0 && !isHeaderRow) {
|
|
|
+ isDataRow = true;
|
|
|
+ }
|
|
|
+ data.put(fields.get(headerIndex), dataCell.getText());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ headerIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ PdfRow row = pdfRows.get(key);
|
|
|
+ //判断表格中哪些数据是标题行
|
|
|
+ if(isHeaderRow) {
|
|
|
+ row.setRowType("header");
|
|
|
+ if(isMultiHeader) {
|
|
|
+ if(headerRowHighY == tableStartY) {//说明所选关键词是标题行的第一行
|
|
|
+ Float nextKey = sortKeys.get(index + 1);
|
|
|
+ PdfRow nextRow = pdfRows.get(nextKey);
|
|
|
+ nextRow.setRowType("header");
|
|
|
+ pdfRows.put(nextKey, nextRow);
|
|
|
+ preBorderY = nextRow.getRowY();
|
|
|
+ }else if(headerRowLowY == tableStartY) {//说明所选关键词是标题行的最后一行
|
|
|
+
|
|
|
+ PdfRow preRow = tableDataRows.get(tableDataRows.size() - 1);
|
|
|
+ preRow.setRowType("header");
|
|
|
+ tableDataRows.set(tableDataRows.size() - 1, preRow);
|
|
|
+ preBorderY = row.getRowY();
|
|
|
+ }else {
|
|
|
+ Float nextKey = sortKeys.get(index + 1);
|
|
|
+ PdfRow nextRow = pdfRows.get(nextKey);
|
|
|
+ nextRow.setRowType("header");
|
|
|
+ pdfRows.put(nextKey, nextRow);
|
|
|
+
|
|
|
+ PdfRow preRow = tableDataRows.get(tableDataRows.size() - 1);
|
|
|
+ preRow.setRowType("header");
|
|
|
+ tableDataRows.set(tableDataRows.size() - 1, preRow);
|
|
|
+ preBorderY = nextRow.getRowY();
|
|
|
+ }
|
|
|
+ PdfRow borderRow = new PdfRow();
|
|
|
+ borderRow.setRowType("border");
|
|
|
+ borderRow.setRowY(preBorderY);
|
|
|
+ borderRow.setHeight(500000);
|
|
|
+ tableDataRows.add(borderRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isDataRow) {
|
|
|
+ row.setRowType("data");
|
|
|
+ //dataObject.put(key, data);
|
|
|
+ if(preBorderY == headerRowLowY) {
|
|
|
+ PdfRow borderRow = new PdfRow();
|
|
|
+ borderRow.setRowType("border");
|
|
|
+ borderRow.setRowY(preBorderY);
|
|
|
+ borderRow.setHeight(500000);
|
|
|
+ tableDataRows.add(borderRow);
|
|
|
+ }
|
|
|
+
|
|
|
+ preBorderY = (key - preBorderY) + key;
|
|
|
+
|
|
|
+ PdfRow borderRow = new PdfRow();
|
|
|
+ borderRow.setRowType("border");
|
|
|
+ borderRow.setRowY(preBorderY);
|
|
|
+ borderRow.setHeight(500000);
|
|
|
+ tableDataRows.add(borderRow);
|
|
|
+
|
|
|
+ }
|
|
|
+ if (isExtraRow) {
|
|
|
+ row.setRowType("extra");
|
|
|
+ }
|
|
|
+ tableDataRows.add(row);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ index ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ tableDataRows = tableDataRows.stream().sorted(Comparator.comparing(PdfRow::getRowY).thenComparing(PdfRow::getHeight)).collect(Collectors.toList());
|
|
|
+ if (tableDataRows != null && tableDataRows.size() > 0) {
|
|
|
+ Boolean needSupple = true;//补充行标志
|
|
|
+ JSONObject needSuppleRow = new JSONObject();
|
|
|
+ Float needSuppleRowY = null;
|
|
|
+ List<PdfRow> rowDatas = new ArrayList<>();
|
|
|
+ for (PdfRow row : tableDataRows) {
|
|
|
+ if ("extra".equals(row.getRowType()) || "header".equals(row.getRowType())) {
|
|
|
+ needSupple = false;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if("border".equals(row.getRowType())) {
|
|
|
+ needSupple = true;
|
|
|
+
|
|
|
+ if(rowDatas != null && rowDatas.size() > 0) {
|
|
|
+ needSuppleRowY = rowDatas.get(0).getRowY();
|
|
|
+ needSuppleRow = new JSONObject();
|
|
|
+ for(PdfRow rowData : rowDatas) {
|
|
|
+ for (PdfCell dataCell : rowData.getCell()) {
|
|
|
+ int headerIndex = 0;
|
|
|
+ for (PdfCell cell : headerRow.getCell()) {
|
|
|
+ if (dataCell.getCellStartX() >= cell.getCellStartX() && dataCell.getCellEndX() <= cell.getCellEndX()) {
|
|
|
+ //data.put(fields.get(headerIndex), dataCell.getText());
|
|
|
+
|
|
|
+ needSuppleRow.put(fields.get(headerIndex), Objects.toString(needSuppleRow.get(fields.get(headerIndex)), "") + " " + dataCell.getText());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ headerIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dataObject.put(needSuppleRowY, needSuppleRow);
|
|
|
+ }
|
|
|
+ rowDatas = new ArrayList<>();
|
|
|
+ }else if(needSupple){
|
|
|
+ rowDatas.add(row);
|
|
|
+ }
|
|
|
+
|
|
|
+// if ("data".equals(row.getRowType())) {
|
|
|
+// needSupple = true;
|
|
|
+// needSuppleRowY = row.getCell().get(0).getCellY();
|
|
|
+// needSuppleRow = dataObject.get(needSuppleRowY);
|
|
|
+//
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// if ("extra".equals(row.getRowType()) || "header".equals(row.getRowType()) || "border".equals(row.getRowType())) {
|
|
|
+// needSupple = false;
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// if (needSupple && needSuppleRow != null) {
|
|
|
+// for (PdfCell dataCell : row.getCell()) {
|
|
|
+// int headerIndex = 0;
|
|
|
+// for (PdfCell cell : headerRow.getCell()) {
|
|
|
+// if (dataCell.getCellStartX() >= cell.getCellStartX() && dataCell.getCellEndX() <= cell.getCellEndX()) {
|
|
|
+// //data.put(fields.get(headerIndex), dataCell.getText());
|
|
|
+//
|
|
|
+// needSuppleRow.put(fields.get(headerIndex), needSuppleRow.get(fields.get(headerIndex)) + " " + dataCell.getText());
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// headerIndex++;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// dataObject.put(needSuppleRowY, needSuppleRow);
|
|
|
+//
|
|
|
+// }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //排序返回
|
|
|
+ List<Float> collect = dataObject.keySet().stream().sorted().collect(Collectors.toList());
|
|
|
+ for (Float key : collect) {
|
|
|
+ result.add(dataObject.get(key));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 设置PDF表格标题所在行号
|
|
|
*
|
|
@@ -809,6 +1158,7 @@ public class PDFTableReader<T> {
|
|
|
return points;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static List<String> getFields(MultipartFile file, String startText, String endText, boolean sort) {
|
|
|
//获取文档坐标
|
|
|
List<String> result = new ArrayList<>();
|
|
@@ -875,6 +1225,7 @@ public class PDFTableReader<T> {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static List<String> getFields(MultipartFile file, String startText, String endText, String cutText, boolean sort) {
|
|
|
//获取文档坐标
|
|
|
List<String> result = new ArrayList<>();
|
|
@@ -941,6 +1292,7 @@ public class PDFTableReader<T> {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static List<String> getMultipleLineFields(MultipartFile file, String lineStartText, String lineEndText, String[] extraLines, boolean sort) {
|
|
|
//获取文档坐标
|
|
|
List<String> result = new ArrayList<>();
|
|
@@ -1009,6 +1361,7 @@ public class PDFTableReader<T> {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static List<String> getNextLineFields(MultipartFile file, String lineStartText) {
|
|
|
//获取文档坐标
|
|
|
List<String> result = new ArrayList<>();
|
|
@@ -1066,6 +1419,7 @@ public class PDFTableReader<T> {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static JSONArray getTableByPosition(MultipartFile file, List<String> fields, List<String> ignoreFields, String endKey, int tableEndIndex, String headerAlignment, String standardX, String headerYText, String[] extraTableLine, int dataColumn, int headerLimit) {
|
|
|
JSONArray result = new JSONArray();
|
|
|
Map<String, List<PdfTextPosition>> documentPositions = new HashMap<>();
|
|
@@ -1450,6 +1804,7 @@ public class PDFTableReader<T> {
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static PdfTable getHeaderAndIgnoreLine(MultipartFile file, List<String> fields, List<String> ignoreFields, String endKey, int tableEndIndex, Map<String, List<PdfTextPosition>> documentPositions, String headerAlignment, String standardX, String headerYText, String[] extraLines, int headerLimit) {
|
|
|
PdfTable pdfTable = new PdfTable();
|
|
|
|