Browse Source

重写预览页面的打印功能

sunyj 9 years ago
parent
commit
79938ddc2c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/main/webapp/resources/js/preview2/app.js

+ 8 - 0
src/main/webapp/resources/js/preview2/app.js

@@ -15,6 +15,14 @@ getWindowWidth();
 loadPdfData();
 getDocument();
 
+//是否立即打印
+var printType = getParameter("printType");
+if (printType && printType == 'PRINT') {
+	hiddenframe.onload = function() {
+		hiddenframe.contentWindow.print();
+	}
+}
+
 // 上页
 $("#prev").click(function() {
 	if (pageIndex <= 1) {