pdf추출 수정

main
이범준 10 months ago
parent b5bd613129
commit 94cc54bb86

@ -12,13 +12,13 @@ import org.apache.pdfbox.pdmodel.PDPageTree;
public class PDFUtil { public class PDFUtil {
public static List<Extraction> extract(String pdfName) { public static List<Extraction> extract(String pdfPath, String templateId) {
List<Extraction> extractList = new ArrayList<Extraction>(); List<Extraction> extractList = new ArrayList<Extraction>();
File file = null; File file = null;
try { try {
file = new File(pdfName); file = new File(pdfPath);
} catch (Exception e2) { } catch (Exception e2) {
e2.printStackTrace(); e2.printStackTrace();
} }
@ -42,7 +42,8 @@ public class PDFUtil {
extraction = new Extraction(); extraction = new Extraction();
extraction.setPage(pageIndex+1); extraction.setPage(pageIndex+1);
String epayNo = ExtractText.getExtractByStng(pdDocument, pageIndex+1, 0 , 0, 100, 100); //설정 = mapper.get설정(query.setSggCd().setTemplateId(templateId));
String epayNo = ExtractText.getExtractByStng(pdDocument, pageIndex+1, 0, 0, 100, 100);
extraction.setEpayNo(epayNo); extraction.setEpayNo(epayNo);

@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.cmmn.pdf.PDFUtil; import cokr.xit.fims.cmmn.pdf.PDFUtil;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController; import cokr.xit.foundation.web.AbstractController;
@Controller @Controller
@ -21,9 +22,13 @@ public class LinkController extends AbstractController {
System.out.println("업무 : " + job); System.out.println("업무 : " + job);
System.out.println("파라미터 : "+ param); System.out.println("파라미터 : "+ param);
DataObject dataObject = fromJson(param, DataObject.class);
//차세대 세외수입 pdf파일 정보 추출 //차세대 세외수입 pdf파일 정보 추출
if(job.equals("01")) { if(job.equals("01")) {
PDFUtil.extract(param); String tmplatId = dataObject.string("tmplatId");
PDFUtil.extract(filePath, tmplatId);
} }
mav.addObject("saved", saved); mav.addObject("saved", saved);

@ -241,7 +241,7 @@ $("#btnComplete").on("click", function(){
filePath : $("#filePath").val(), filePath : $("#filePath").val(),
job : $("#selectJob").val(), job : $("#selectJob").val(),
}; };
var param = "{ " + "'tmplatId'" + " : " + $("#tmplatId").val() + " }"; var param = '{ ' + '"tmplatId"' + ' : ' + '"' + $("#tmplatId").val() + '"' + ' }';
data.param = param; data.param = param;

Loading…
Cancel
Save