pdf 미리보기 수정

main
이범준 2 months ago
parent cc2aa7d441
commit b1cc53bab1

@ -3,54 +3,32 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/webjars/image/favicon.ico" />
<!-- Icons. Uncomment required icon fonts -->
<link rel="stylesheet" href="/webjars/3rd-party/sneat/fonts/boxicons.css" />
<link rel="stylesheet" href="/webjars/3rd-party/sneat/fonts/fontawesome.css" />
<!-- Core CSS -->
<link rel="stylesheet" href="/webjars/3rd-party/sneat/css/rtl/core.css" class="template-customizer-core-css" />
<link rel="stylesheet" href="/webjars/3rd-party/sneat/css/rtl/theme-default.css" class="template-customizer-theme-css" />
<link rel="stylesheet" href="/webjars/css/styles.css" />
<link rel="stylesheet" href="/webjars/applib/css/overwrite.css" />
<link rel="stylesheet" href="/webjars/applib/css/applib.css" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="/webjars/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.css" />
<title>샘플 보기</title> <title>샘플 보기</title>
</head> </head>
<body> <body>
<div id="example" class="h-px-950"> <div id="example" style="height:950px!important">
</div> </div>
<!-- Core JS -->
<script src="/webjars/3rd-party/sneat/libs/popper/popper.js"></script>
<script src="/webjars/3rd-party/sneat/js/bootstrap.js"></script>
<script src="/webjars/3rd-party/sneat/libs/jquery/jquery.js" ></script>
<script src="/webjars/3rd-party/sneat/js/config.js"></script>
<script src="/webjars/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="/webjars/3rd-party/sneat/js/helpers.js"></script>
<script src="/webjars/3rd-party/sneat/js/menu.js"></script>
<!-- base -->
<script src="/webjars/js/base/base.js"></script>
<script src="/webjars/js/base/dataset.js"></script>
<script src="/webjars/applib/js/pdfobject.js"></script>
<script> <script>
var param = location.search;
var path = param.substr(1).split("=")[1];
if(path == "/"){
path = "";
}
path += "/webjars/applib/js/pdfobject.js";
var js_script = document.createElement("script");
js_script.src = path;
document.body.appendChild(js_script);
function makePdfFromBlob(blob){ function makePdfFromBlob(blob){
var url = URL.createObjectURL(blob); var url = URL.createObjectURL(blob);
PDFObject.embed(url, "#example"); PDFObject.embed(url, "#example");
} }
</script> </script>
</body> </body>

@ -213,13 +213,15 @@ class AppSupport {
* PDF파일 미리보기 열기 * PDF파일 미리보기 열기
**************************************************************************/ **************************************************************************/
static openPDF(blob, windowName){ static openPDF(blob, windowName){
let wctxpath = wctx.path;
var popup = window.open( var popup = window.open(
wctx.url("/webjars/applib/html/pdf.html") wctx.url("/webjars/applib/html/pdf.html")+"?wctxpath="+wctxpath
,windowName ,windowName
,'top=10, left=10' ,'top=10, left=10'
); );
popup.onload = () => { popup.onload = () => {
popup.makePdfFromBlob(blob); popup.makePdfFromBlob(blob);
}; };
} }

Loading…
Cancel
Save