pdf출력시 새창에서 미리보기 화면이 표시되도록 수정

main
이범준 10 months ago
parent 8f7b53a6c9
commit 3f903d859d

@ -143,12 +143,13 @@ $(document).ready(function(){
data : submitParam,
success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
if(fileType == "pdf"){
openPDF(resp.filePath, resp.fileName, resp.fileName);
} else {
downloadFile(resp.filePath, resp.fileName, "tempArea--${pageName}");
}
}
}
});

@ -141,12 +141,13 @@ $(document).ready(function(){
data : submitParam,
success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a);
a.click();
document.getElementById("tempArea--${pageName}").removeChild(a);
if(fileType == "pdf"){
openPDF(resp.filePath, resp.fileName, resp.fileName);
} else {
downloadFile(resp.filePath, resp.fileName, "tempArea--${pageName}");
}
}
}
});

@ -764,15 +764,7 @@ $(document).ready(function(){
data : submitParam,
success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){
var samplePath = resp.filePath;
samplePath = samplePath.replaceAll("\\","%5c");
window.open(
wctx.url("/resources/html/pdf.html"+"?"+"path="+samplePath)
,"pdf_sample"
,'top=10, left=10'
);
openPDF(resp.filePath, resp.fileName, "pdf_sample");
}
}
});

@ -1,3 +1,22 @@
function download(filePath, fileName, tempAreaId){
var a = document.createElement("a");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById(tempAreaId).appendChild(a);
a.click();
document.getElementById(tempAreaId).removeChild(a);
}
function openPDF(filePath, fileName, windowName){
filePath = filePath.replaceAll("\\","%5c");
window.open(
wctx.url("/resources/html/pdf.html"+"?"+"path="+filePath)
,windowName
,'top=10, left=10'
);
}
//엑셀 파일 생성 정보
function getCellDefs($th, $td){
var cellDefs = [];

Loading…
Cancel
Save