mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-04-08 09:17:36 +00:00
新功能点:新增配置是否可以下载转换完成的pdf文件
This commit is contained in:
@@ -1932,10 +1932,12 @@ function webViewerInitialized() {
|
||||
var appConfig = PDFViewerApplication.appConfig;
|
||||
var file = void 0;
|
||||
var base = void 0;
|
||||
var disableDownload = void 0;
|
||||
var queryString = document.location.search.substring(1);
|
||||
var params = (0, _ui_utils.parseQueryString)(queryString);
|
||||
file = 'file' in params ? params.file : appConfig.defaultUrl;
|
||||
base = 'base' in params ? params.base : appConfig.defaultUrl;
|
||||
disableDownload = 'disabledownload' in params ? params.disabledownload : 'false';
|
||||
file = validateFileURL(file,base);
|
||||
var waitForBeforeOpening = [];
|
||||
var fileInput = document.createElement('input');
|
||||
@@ -2036,6 +2038,9 @@ function webViewerInitialized() {
|
||||
PDFViewerApplication.error(msg, reason);
|
||||
});
|
||||
});
|
||||
if ('true' === disableDownload) {
|
||||
document.getElementById("download").style.display='none';
|
||||
}
|
||||
}
|
||||
var webViewerOpenFileViaURL = void 0;
|
||||
{
|
||||
|
||||
@@ -26,11 +26,10 @@
|
||||
|
||||
<img src="images/jpg.svg" width="63" height="63" style="position: fixed; cursor: pointer; top: 40%; right: 48px; z-index: 999;" alt="使用图片预览" title="使用图片预览" onclick="goForImage()"/>
|
||||
|
||||
|
||||
</body>
|
||||
<script src="js/watermark.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
document.getElementsByTagName('iframe')[0].src = "${baseUrl}pdfjs/web/viewer.html?base=${baseUrl}&file="+encodeURIComponent('${finalUrl}');
|
||||
document.getElementsByTagName('iframe')[0].src = "${baseUrl}pdfjs/web/viewer.html?base=${baseUrl}&file="+encodeURIComponent('${finalUrl}')+"&disabledownload=${pdfDownloadDisable}";
|
||||
document.getElementsByTagName('iframe')[0].height = document.documentElement.clientHeight-10;
|
||||
/**
|
||||
* 页面变化调整高度
|
||||
|
||||
Reference in New Issue
Block a user