From f2a31b6b0f9a9184a9f3828d88a235d6f433750f Mon Sep 17 00:00:00 2001 From: leebj Date: Mon, 9 Sep 2024 18:35:19 +0900 Subject: [PATCH] =?UTF-8?q?pdf=EC=B6=9C=EB=A0=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java index 759ddc9e..5f88dc40 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/print/format/PDFPrintFormat.java @@ -332,6 +332,7 @@ public abstract class PDFPrintFormat { mosSet = this.getMosSet(imageKey, dataObject); } this.insertImage(writer, is, pstn, size); + is.close(); if(otptArtclNm.equals("rprsCrdnPhoto") && !imageKey.equals("") && mosSet != null) { @@ -341,6 +342,7 @@ public abstract class PDFPrintFormat { List transformedMosaicInfos = MediaUtil.getTransformedMosaic( mosSet, is0, new PstnAndSize(pstn[0],pstn[1], size[0], size[1]) ); + is0.close(); for(int k=0; k < transformedMosaicInfos.size(); k++) { PstnAndSize mosaicInfo = transformedMosaicInfos.get(k); @@ -348,6 +350,7 @@ public abstract class PDFPrintFormat { InputStream blackImageStream = new ClassPathResource("samplefiles/black.png").getInputStream(); this.insertImage(writer, blackImageStream, mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float()); + blackImageStream.close(); } } @@ -401,7 +404,7 @@ public abstract class PDFPrintFormat { this.insertImage(writer, is, devideInfo.getPstn().to2Float(), devideInfo.getSize().to2Float()); - + is.close(); if(otptArtclNm.equals("crdnPhoto") && !imageKeys.isEmpty() && !mosSets.isEmpty()) { @@ -414,12 +417,14 @@ public abstract class PDFPrintFormat { List transformedMosaicInfos = MediaUtil.getTransformedMosaic( mosSets.get(i), is0, devideInfo ); + is0.close(); for(int k=0; k < transformedMosaicInfos.size(); k++) { PstnAndSize mosaicInfo = transformedMosaicInfos.get(k); InputStream blackImageStream = new ClassPathResource("samplefiles/black.png").getInputStream(); this.insertImage(writer, blackImageStream, mosaicInfo.getPstn().to2Float(), mosaicInfo.getSize().to2Float()); + blackImageStream.close(); } } @@ -452,6 +457,9 @@ public abstract class PDFPrintFormat { result.put("dataNames", this.filterDownloadDataNames()); } catch(FileNotFoundException e) { + System.out.println("kkkkkk"); + System.out.println(e); + throw new RuntimeException("파일을 찾을 수 없습니다."); } catch (Exception e) { throw new RuntimeException("출력오류."+e);