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