|
|
@ -36,6 +36,8 @@ public abstract class PDFPrintFormat {
|
|
|
|
|
|
|
|
|
|
|
|
protected Print print;
|
|
|
|
protected Print print;
|
|
|
|
protected PrintOption printOption;
|
|
|
|
protected PrintOption printOption;
|
|
|
|
|
|
|
|
protected List<DataObject> data;
|
|
|
|
|
|
|
|
|
|
|
|
protected DataObject otptBscStng;
|
|
|
|
protected DataObject otptBscStng;
|
|
|
|
protected List<DataObject> otptArtclStngList;
|
|
|
|
protected List<DataObject> otptArtclStngList;
|
|
|
|
protected String paperSeCd;
|
|
|
|
protected String paperSeCd;
|
|
|
@ -48,9 +50,9 @@ public abstract class PDFPrintFormat {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PDFPrintFormat(Print print, PrintOption printOption,
|
|
|
|
public PDFPrintFormat(Print print, PrintOption printOption,
|
|
|
|
DataObject otptBscStng, List<DataObject> otptArtclStngList, String paperSeCd) {
|
|
|
|
DataObject otptBscStng, List<DataObject> otptArtclStngList, String paperSeCd, List<DataObject> data) {
|
|
|
|
initDefaultStng();
|
|
|
|
initDefaultStng();
|
|
|
|
|
|
|
|
this.data = data;
|
|
|
|
this.print = print;
|
|
|
|
this.print = print;
|
|
|
|
this.print.setExtension("pdf");
|
|
|
|
this.print.setExtension("pdf");
|
|
|
|
this.printOption = printOption;
|
|
|
|
this.printOption = printOption;
|
|
|
@ -225,14 +227,11 @@ public abstract class PDFPrintFormat {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> makePdfFile(List<DataObject> dataObjectList) {
|
|
|
|
public Map<String, Object> makeFile() {
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
PDFWriter writer = new PDFWriter();
|
|
|
|
PDFWriter writer = new PDFWriter();
|
|
|
|
|
|
|
|
|
|
|
|
String resultFilePath = this.print.pathForNewFile();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//폰트 로드
|
|
|
|
//폰트 로드
|
|
|
|
Map<String, PDType0Font> fontMap = this.getFontMap(writer);
|
|
|
|
Map<String, PDType0Font> fontMap = this.getFontMap(writer);
|
|
|
|
|
|
|
|
|
|
|
@ -274,7 +273,7 @@ public abstract class PDFPrintFormat {
|
|
|
|
rprsCrdnPhotoYn = true;
|
|
|
|
rprsCrdnPhotoYn = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for(DataObject dataObject : dataObjectList) {
|
|
|
|
for(DataObject dataObject : data) {
|
|
|
|
writer.beginPage();
|
|
|
|
writer.beginPage();
|
|
|
|
|
|
|
|
|
|
|
|
boolean completeFoldLine = false;
|
|
|
|
boolean completeFoldLine = false;
|
|
|
@ -448,13 +447,10 @@ public abstract class PDFPrintFormat {
|
|
|
|
} //출력자료건수 loop 끝
|
|
|
|
} //출력자료건수 loop 끝
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writer.saveDocument(resultFilePath);
|
|
|
|
|
|
|
|
writer.closeDocument();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String downloadFileName = this.print.getFormatKorName()+"_"+this.print.getPrintRequestDt()+".pdf";
|
|
|
|
String downloadFileName = this.print.getFormatKorName()+"_"+this.print.getPrintRequestDt()+".pdf";
|
|
|
|
result.put("filename", downloadFileName);
|
|
|
|
result.put("download", writer.getDownloadable().setFilename(downloadFileName));
|
|
|
|
result.put("filePath", resultFilePath);
|
|
|
|
result.put("downloadData", data);
|
|
|
|
result.put("file", new File(resultFilePath));
|
|
|
|
result.put("dataNames", this.filterDownloadDataNames());
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException("출력오류."+e);
|
|
|
|
throw new RuntimeException("출력오류."+e);
|
|
|
|