Просмотр исходного кода

经过近一周的使用测试,重写的预览页面运行良好,现删除旧的预览页面,正式完成替换

sunyj 9 лет назад
Родитель
Сommit
bb2a89847c
100 измененных файлов с 573 добавлено и 1170 удалено
  1. 1 1
      src/main/java/com/uas/report/controller/PrintController.java
  2. 3 5
      src/main/webapp/WEB-INF/views/console.html
  3. 63 518
      src/main/webapp/WEB-INF/views/preview.html
  4. 0 84
      src/main/webapp/WEB-INF/views/preview2.html
  5. 0 1
      src/main/webapp/WEB-INF/webmvc.xml
  6. 0 0
      src/main/webapp/resources/css/preview.css
  7. 506 24
      src/main/webapp/resources/js/preview/app.js
  8. 0 527
      src/main/webapp/resources/js/preview2/app.js
  9. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-EUC-H.bcmap
  10. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-EUC-V.bcmap
  11. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-H.bcmap
  12. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-RKSJ-H.bcmap
  13. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-RKSJ-V.bcmap
  14. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78-V.bcmap
  15. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78ms-RKSJ-H.bcmap
  16. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/78ms-RKSJ-V.bcmap
  17. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/83pv-RKSJ-H.bcmap
  18. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90ms-RKSJ-H.bcmap
  19. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90ms-RKSJ-V.bcmap
  20. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90msp-RKSJ-H.bcmap
  21. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90msp-RKSJ-V.bcmap
  22. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90pv-RKSJ-H.bcmap
  23. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/90pv-RKSJ-V.bcmap
  24. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-H.bcmap
  25. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-RKSJ-H.bcmap
  26. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-RKSJ-V.bcmap
  27. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-V.bcmap
  28. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-0.bcmap
  29. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-1.bcmap
  30. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-2.bcmap
  31. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-3.bcmap
  32. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-4.bcmap
  33. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-5.bcmap
  34. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-6.bcmap
  35. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-UCS2.bcmap
  36. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-0.bcmap
  37. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-1.bcmap
  38. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-2.bcmap
  39. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-3.bcmap
  40. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-4.bcmap
  41. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-5.bcmap
  42. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-UCS2.bcmap
  43. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-0.bcmap
  44. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-1.bcmap
  45. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-2.bcmap
  46. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-3.bcmap
  47. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-4.bcmap
  48. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-5.bcmap
  49. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-6.bcmap
  50. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-UCS2.bcmap
  51. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-0.bcmap
  52. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-1.bcmap
  53. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-2.bcmap
  54. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-UCS2.bcmap
  55. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/B5-H.bcmap
  56. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/B5-V.bcmap
  57. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/B5pc-H.bcmap
  58. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/B5pc-V.bcmap
  59. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS-EUC-H.bcmap
  60. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS-EUC-V.bcmap
  61. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS1-H.bcmap
  62. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS1-V.bcmap
  63. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS2-H.bcmap
  64. 0 3
      src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS2-V.bcmap
  65. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETHK-B5-H.bcmap
  66. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETHK-B5-V.bcmap
  67. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETen-B5-H.bcmap
  68. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETen-B5-V.bcmap
  69. 0 3
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETenms-B5-H.bcmap
  70. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/ETenms-B5-V.bcmap
  71. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/EUC-H.bcmap
  72. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/EUC-V.bcmap
  73. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-H.bcmap
  74. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-RKSJ-H.bcmap
  75. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-RKSJ-V.bcmap
  76. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-V.bcmap
  77. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-EUC-H.bcmap
  78. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-EUC-V.bcmap
  79. 0 4
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-H.bcmap
  80. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-V.bcmap
  81. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK-EUC-H.bcmap
  82. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK-EUC-V.bcmap
  83. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK2K-H.bcmap
  84. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK2K-V.bcmap
  85. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBKp-EUC-H.bcmap
  86. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBKp-EUC-V.bcmap
  87. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-EUC-H.bcmap
  88. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-EUC-V.bcmap
  89. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-H.bcmap
  90. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-V.bcmap
  91. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBTpc-EUC-H.bcmap
  92. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBTpc-EUC-V.bcmap
  93. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBpc-EUC-H.bcmap
  94. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/GBpc-EUC-V.bcmap
  95. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/H.bcmap
  96. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdla-B5-H.bcmap
  97. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdla-B5-V.bcmap
  98. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdlb-B5-H.bcmap
  99. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdlb-B5-V.bcmap
  100. BIN
      src/main/webapp/resources/lib/pdf.js/web/cmaps/HKgccs-B5-H.bcmap

+ 1 - 1
src/main/java/com/uas/report/controller/PrintController.java

@@ -79,7 +79,7 @@ public class PrintController {
 		if (printType.equals(ReportConstants.PREVIEW_PRINT_TYPE)
 				|| printType.equals(ReportConstants.PRINT_PRINT_TYPE)) {
 			try {
-				request.getRequestDispatcher("preview2").forward(request, response);
+				request.getRequestDispatcher("preview").forward(request, response);
 			} catch (IOException | ServletException e) {
 				throw new ReportException(e).setDetailedMessage(e);
 			}

+ 3 - 5
src/main/webapp/WEB-INF/views/console.html

@@ -14,15 +14,13 @@
 				<ol>
 					<li><a target="_blank">print?userName=UAS&reportName=Purchase&whereCondition=where
 							%20rownum<10&otherParameters={'id':1}&printType=PREVIEW</a></li>
-					<li><a target="_blank">preview?userName=UAS&reportName=Purchase&whereCondition=where
+					<li><a target="_blank">preview?userName=UAS_TEST&reportName=Purchase&whereCondition=where
 							%20rownum<11&printType=PREVIEW</a></li>
-					<li><a target="_blank">preview2?userName=UAS&reportName=Purchase&whereCondition=where
-							%20rownum<12&printType=PREVIEW</a></li>
 				</ol>
 
 				<strong><li class="title1">打印</li></strong>
 				<ol>
-					<li><a target="_blank">print?userName=UAS&reportName=Purchase&whereCondition=where
+					<li><a target="_blank">print?userName=UAS_TEST&reportName=AccountRegZW_fybx&whereCondition=where
 							%20rownum<13&printType=PRINT</a></li>
 				</ol>
 
@@ -101,7 +99,7 @@
 				</ol>
 				<strong><li class="title2">B2B</li></strong>
 				<ol>
-					<li><a target="_blank">print?userName=B2B/10005740&profile=test&reportName=order&whereCondition=where
+					<li><a target="_blank">print?userName=B2B/10005740&profile=test&reportName=PURCLIST&whereCondition=where
 							%20rownum<30</a></li>
 					<li><a target="_blank">fileUpload?userName=B2B/1111</a></li>
 				</ol>

+ 63 - 518
src/main/webapp/WEB-INF/views/preview.html

@@ -1,539 +1,84 @@
 <!DOCTYPE html>
-<!--
-Copyright 2012 Mozilla Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Adobe CMap resources are covered by their own copyright but the same license:
-
-    Copyright 1990-2015 Adobe Systems Incorporated.
-
-See https://github.com/adobe-type-tools/cmap-resources
--->
-<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
+<html>
 <head>
-<meta charset="utf-8">
-<meta name="viewport"
-	content="width=device-width, initial-scale=1, maximum-scale=1">
-<meta name="google" content="notranslate">
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<title>在线预览</title>
-
-<link rel="stylesheet" href="static/lib/pdf.js/web/viewer.css">
+<meta charset="UTF-8">
+<title>Preview</title>
+<link rel="stylesheet" href="static/css/preview.css">
 <link rel="stylesheet"
 	href="static/lib/fontawesome/css/font-awesome.min.css">
-
-<!-- This snippet is used in production (included from viewer.html) -->
-<link rel="resource" type="application/l10n"
-	href="static/lib/pdf.js/web/locale/locale.properties">
-
 </head>
-
-<body tabindex="1" class="loadingInProgress">
-	<div id="outerContainer">
-
-		<div id="sidebarContainer">
-			<div id="toolbarSidebar">
-				<div class="splitToolbarButton toggled">
-					<button id="viewThumbnail" class="toolbarButton group toggled"
-						title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
-						<span data-l10n-id="thumbs_label">Thumbnails</span>
-					</button>
-					<button id="viewOutline" hidden='true' class="toolbarButton group"
-						title="Show Document Outline" tabindex="3" data-l10n-id="outline">
-						<span data-l10n-id="outline_label">Document Outline</span>
-					</button>
-					<button id="viewAttachments" hidden='true'
-						class="toolbarButton group" title="Show Attachments" tabindex="4"
-						data-l10n-id="attachments">
-						<span data-l10n-id="attachments_label">Attachments</span>
-					</button>
-				</div>
-			</div>
-			<div id="sidebarContent">
-				<div id="thumbnailView"></div>
-				<div id="outlineView" class="hidden"></div>
-				<div id="attachmentsView" class="hidden"></div>
-			</div>
+<body>
+	<div id="toolbarContainer">
+		<div id="toolbarViewerLeft">
+			<button id="zoomOut" class="toolbarButton" title="缩小">
+				<i class="fa fa-minus fa-lg" aria-hidden="true"></i>
+			</button>
+			<button id="zoomIn" class="toolbarButton" title="放大">
+				<i class="fa fa-plus fa-lg" aria-hidden="true"></i>
+			</button>
+			<label class="select"> <select id="scaleSelect">
+					<option value="auto" selected="selected">自动缩放</option>
+					<option value="page_width">适合页宽</option>
+					<option value="0.25">25%</option>
+					<option value="0.5">50%</option>
+					<option value="0.75">75%</option>
+					<option value="1" title="原始宽度">100%</option>
+					<option value="1.25">125%</option>
+					<option value="1.5">150%</option>
+					<option value="2">200%</option>
+					<option value="3">300%</option>
+					<option value="4">400%</option>
+					<option id="hiddenOption" hidden="true"></option>
+			</select>
+			</label>
 		</div>
-		<!-- sidebarContainer -->
-
-		<div id="mainContainer">
-			<div class="findbar hidden doorHanger hiddenSmallView" id="findbar">
-				<label for="findInput" class="toolbarLabel"
-					data-l10n-id="find_label">Find:</label> <input id="findInput"
-					class="toolbarField" tabindex="91">
-				<div class="splitToolbarButton">
-					<button class="toolbarButton findPrevious" title=""
-						id="findPrevious" tabindex="92" data-l10n-id="find_previous">
-						<span data-l10n-id="find_previous_label">Previous</span>
-					</button>
-					<div class="splitToolbarButtonSeparator"></div>
-					<button class="toolbarButton findNext" title="" id="findNext"
-						tabindex="93" data-l10n-id="find_next">
-						<span data-l10n-id="find_next_label">Next</span>
-					</button>
-				</div>
-				<input type="checkbox" id="findHighlightAll" class="toolbarField"
-					tabindex="94"> <label for="findHighlightAll"
-					class="toolbarLabel" data-l10n-id="find_highlight">Highlight
-					all</label> <input type="checkbox" id="findMatchCase" class="toolbarField"
-					tabindex="95"> <label for="findMatchCase"
-					class="toolbarLabel" data-l10n-id="find_match_case_label">Match
-					case</label> <span id="findResultsCount" class="toolbarLabel hidden"></span>
-				<span id="findMsg" class="toolbarLabel"></span>
-			</div>
-			<!-- findbar -->
-
-			<div id="secondaryToolbar"
-				class="secondaryToolbar hidden doorHangerRight">
-				<div id="secondaryToolbarButtonContainer">
-					<button id="secondaryPresentationMode"
-						class="secondaryToolbarButton presentationMode visibleLargeView"
-						title="Switch to Presentation Mode" tabindex="51"
-						data-l10n-id="presentation_mode">
-						<span data-l10n-id="presentation_mode_label">Presentation
-							Mode</span>
-					</button>
-
-					<button id="secondaryOpenFile"
-						class="secondaryToolbarButton openFile visibleLargeView"
-						title="Open File" tabindex="52" data-l10n-id="open_file">
-						<span data-l10n-id="open_file_label">Open</span>
-					</button>
-
-					<button id="secondaryPrint"
-						class="secondaryToolbarButton print visibleMediumView"
-						title="Print" tabindex="53" data-l10n-id="print">
-						<span data-l10n-id="print_label">Print</span>
-					</button>
-
-					<button id="secondaryDownload"
-						class="secondaryToolbarButton download visibleMediumView"
-						title="Download" tabindex="54" data-l10n-id="download">
-						<span data-l10n-id="download_label">Download</span>
-					</button>
-
-					<a href="#" id="secondaryViewBookmark"
-						class="secondaryToolbarButton bookmark visibleSmallView"
-						title="Current view (copy or open in new window)" tabindex="55"
-						data-l10n-id="bookmark"> <span data-l10n-id="bookmark_label">Current
-							View</span>
-					</a>
-
-					<div class="horizontalToolbarSeparator visibleLargeView"></div>
-
-					<button id="firstPage" class="secondaryToolbarButton firstPage"
-						title="Go to First Page" tabindex="56" data-l10n-id="first_page">
-						<span data-l10n-id="first_page_label">Go to First Page</span>
-					</button>
-					<button id="lastPage" class="secondaryToolbarButton lastPage"
-						title="Go to Last Page" tabindex="57" data-l10n-id="last_page">
-						<span data-l10n-id="last_page_label">Go to Last Page</span>
-					</button>
-
-					<div class="horizontalToolbarSeparator"></div>
-
-					<button id="pageRotateCw" class="secondaryToolbarButton rotateCw"
-						title="Rotate Clockwise" tabindex="58"
-						data-l10n-id="page_rotate_cw">
-						<span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
-					</button>
-					<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw"
-						title="Rotate Counterclockwise" tabindex="59"
-						data-l10n-id="page_rotate_ccw">
-						<span data-l10n-id="page_rotate_ccw_label">Rotate
-							Counterclockwise</span>
-					</button>
 
-					<div class="horizontalToolbarSeparator"></div>
-
-					<button id="toggleHandTool" class="secondaryToolbarButton handTool"
-						title="Enable hand tool" tabindex="60"
-						data-l10n-id="hand_tool_enable">
-						<span data-l10n-id="hand_tool_enable_label">Enable hand
-							tool</span>
-					</button>
-
-					<div class="horizontalToolbarSeparator"></div>
-
-					<button id="documentProperties"
-						class="secondaryToolbarButton documentProperties"
-						title="Document Properties…" tabindex="61"
-						data-l10n-id="document_properties">
-						<span data-l10n-id="document_properties_label">Document
-							Properties…</span>
-					</button>
-				</div>
-			</div>
-			<!-- secondaryToolbar -->
-
-			<div class="toolbar">
-				<div id="toolbarContainer">
-					<div id="toolbarViewer">
-						<div id="toolbarViewerLeft">
-							<button id="sidebarToggle" class="toolbarButton"
-								title="Toggle Sidebar" tabindex="11"
-								data-l10n-id="toggle_sidebar">
-								<span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
-							</button>
-							<div class="toolbarButtonSpacer"></div>
-							<button id="viewFind" class="toolbarButton group hiddenSmallView"
-								title="Find in Document" tabindex="12" data-l10n-id="findbar">
-								<span data-l10n-id="findbar_label">Find</span>
-							</button>
-							<div class="splitToolbarButton">
-								<button class="toolbarButton pageUp" title="Previous Page"
-									id="previous" tabindex="13" data-l10n-id="previous">
-									<span data-l10n-id="previous_label">Previous</span>
-								</button>
-								<div class="splitToolbarButtonSeparator"></div>
-								<button class="toolbarButton pageDown" title="Next Page"
-									id="next" tabindex="14" data-l10n-id="next">
-									<span data-l10n-id="next_label">Next</span>
-								</button>
-							</div>
-							<label id="pageNumberLabel" class="toolbarLabel" for="pageNumber"
-								data-l10n-id="page_label">Page: </label> <input type="number"
-								id="pageNumber" class="toolbarField pageNumber" value="1"
-								size="4" min="1" tabindex="15"> <span id="numPages"
-								class="toolbarLabel"></span>
-						</div>
-						<div id="toolbarViewerRight">
-							<button id="presentationMode"
-								class="toolbarButton presentationMode hiddenLargeView"
-								title="Switch to Presentation Mode" tabindex="31"
-								data-l10n-id="presentation_mode">
-								<span data-l10n-id="presentation_mode_label">Presentation
-									Mode</span>
-							</button>
-
-							<button id="openFile" hidden='true'
-								class="toolbarButton openFile hiddenLargeView" title="Open File"
-								tabindex="32" data-l10n-id="open_file">
-								<span data-l10n-id="open_file_label">Open</span>
-							</button>
-
-							<!-- pdf.js自带打印功能,因为使用canvas,打印效果不好,字迹模糊 -->
-							<button id="print" class="toolbarButton print hiddenMediumView"
-								title="Print" tabindex="33" data-l10n-id="print" hidden='true'>
-								<span data-l10n-id="print_label">Print</span>
-							</button>
-							<!-- 自己实现打印功能 -->
-							<button id="print2" class="toolbarButton print hiddenMediumView" title="打印" tabindex="33" data-l10n-id="print">
-								<i class="fa fa-print"></i>
-							</button>
-							<button id="download" hidden='true'
-								class="toolbarButton download hiddenMediumView" title="Download"
-								tabindex="34" data-l10n-id="download">
-								<span data-l10n-id="download_label">Download</span>
-							</button>
-							<button id="download_pdf" class="toolbarButton hiddenMediumView"
-								title="下载PDF" tabindex="35">
-								<i class="fa fa-file-pdf-o fa-lg"></i>
-							</button>
-							<button id="download_excel_with_only_data"
-								class="toolbarButton hiddenMediumView" title="下载Excel(仅数据)"
-								tabindex="37">
-								<i class="fa fa-file-excel-o fa-lg"></i>
-							</button>
-							<a href="#" id="viewBookmark" hidden='true'
-								class="toolbarButton bookmark hiddenSmallView"
-								title="Current view (copy or open in new window)" tabindex="38"
-								data-l10n-id="bookmark"> <span data-l10n-id="bookmark_label">Current
-									View</span>
-							</a>
-
-							<div class="verticalToolbarSeparator hiddenSmallView"></div>
-
-							<button id="secondaryToolbarToggle" class="toolbarButton"
-								title="Tools" tabindex="39" data-l10n-id="tools">
-								<span data-l10n-id="tools_label">Tools</span>
-							</button>
-						</div>
-						<div class="outerCenter">
-							<div class="innerCenter" id="toolbarViewerMiddle">
-								<div class="splitToolbarButton">
-									<button id="zoomOut" class="toolbarButton zoomOut"
-										title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">
-										<span data-l10n-id="zoom_out_label">Zoom Out</span>
-									</button>
-									<div class="splitToolbarButtonSeparator"></div>
-									<button id="zoomIn" class="toolbarButton zoomIn"
-										title="Zoom In" tabindex="22" data-l10n-id="zoom_in">
-										<span data-l10n-id="zoom_in_label">Zoom In</span>
-									</button>
-								</div>
-								<span id="scaleSelectContainer" class="dropdownToolbarButton">
-									<select id="scaleSelect" title="Zoom" tabindex="23"
-									data-l10n-id="zoom">
-										<option id="pageAutoOption" title="" value="auto"
-											selected="selected" data-l10n-id="page_scale_auto">Automatic
-											Zoom</option>
-										<option id="pageActualOption" title="" value="page-actual"
-											data-l10n-id="page_scale_actual">Actual Size</option>
-										<option id="pageFitOption" title="" value="page-fit"
-											data-l10n-id="page_scale_fit">Fit Page</option>
-										<option id="pageWidthOption" title="" value="page-width"
-											data-l10n-id="page_scale_width">Full Width</option>
-										<option id="customScaleOption" title="" value="custom"></option>
-										<option title="" value="0.5" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 50 }'>50%</option>
-										<option title="" value="0.75"
-											data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 75 }'>75%</option>
-										<option title="" value="1" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 100 }'>100%</option>
-										<option title="" value="1.25"
-											data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 125 }'>125%</option>
-										<option title="" value="1.5" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 150 }'>150%</option>
-										<option title="" value="2" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 200 }'>200%</option>
-										<option title="" value="3" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 300 }'>300%</option>
-										<option title="" value="4" data-l10n-id="page_scale_percent"
-											data-l10n-args='{ "scale": 400 }'>400%</option>
-								</select>
-								</span>
-							</div>
-						</div>
-					</div>
-					<div id="loadingBar">
-						<div class="progress">
-							<div class="glimmer"></div>
-						</div>
-					</div>
-				</div>
-			</div>
-
-			<menu type="context" id="viewerContextMenu">
-				<menuitem id="contextFirstPage" label="First Page"
-					data-l10n-id="first_page"></menuitem>
-				<menuitem id="contextLastPage" label="Last Page"
-					data-l10n-id="last_page"></menuitem>
-				<menuitem id="contextPageRotateCw" label="Rotate Clockwise"
-					data-l10n-id="page_rotate_cw"></menuitem>
-				<menuitem id="contextPageRotateCcw" label="Rotate Counter-Clockwise"
-					data-l10n-id="page_rotate_ccw"></menuitem>
-			</menu>
-
-			<div id="viewerContainer" tabindex="0">
-				<div id="viewer" class="pdfViewer"></div>
-			</div>
-
-			<div id="errorWrapper" hidden='true'>
-				<div id="errorMessageLeft">
-					<span id="errorMessage"></span>
-					<button id="errorShowMore" data-l10n-id="error_more_info">
-						More Information</button>
-					<button id="errorShowLess" data-l10n-id="error_less_info"
-						hidden='true'>Less Information</button>
-				</div>
-				<div id="errorMessageRight">
-					<button id="errorClose" data-l10n-id="error_close">Close</button>
-				</div>
-				<div class="clearBoth"></div>
-				<textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea>
-			</div>
+		<div id="toobarViewerCenter">
+			<button id="prev" class="toolbarButton" title="上页">
+				<i class="fa fa-arrow-left fa-lg" aria-hidden="true"></i>
+			</button>
+			<span><input id="pageIndex" type="text" /> / <span
+				id="pageSize">0</span></span>
+			<button id="next" class="toolbarButton" title="下页">
+				<i class="fa fa-arrow-right fa-lg" aria-hidden="true"></i>
+			</button>
 		</div>
-		<!-- mainContainer -->
 
-		<div id="overlayContainer" class="hidden">
-			<div id="passwordOverlay" class="container hidden">
-				<div class="dialog">
-					<div class="row">
-						<p id="passwordText" data-l10n-id="password_label">Enter the
-							password to open this PDF file:</p>
-					</div>
-					<div class="row">
-						<!-- The type="password" attribute is set via script, to prevent warnings in Firefox for all http:// documents. -->
-						<input id="password" class="toolbarField">
-					</div>
-					<div class="buttonRow">
-						<button id="passwordCancel" class="overlayButton">
-							<span data-l10n-id="password_cancel">Cancel</span>
-						</button>
-						<button id="passwordSubmit" class="overlayButton">
-							<span data-l10n-id="password_ok">OK</span>
-						</button>
-					</div>
-				</div>
-			</div>
-			<div id="documentPropertiesOverlay" class="container hidden">
-				<div class="dialog">
-					<div class="row">
-						<span data-l10n-id="document_properties_file_name">File
-							name:</span>
-						<p id="fileNameField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_file_size">File
-							size:</span>
-						<p id="fileSizeField">-</p>
-					</div>
-					<div class="separator"></div>
-					<div class="row">
-						<span data-l10n-id="document_properties_title">Title:</span>
-						<p id="titleField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_author">Author:</span>
-						<p id="authorField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_subject">Subject:</span>
-						<p id="subjectField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_keywords">Keywords:</span>
-						<p id="keywordsField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_creation_date">Creation
-							Date:</span>
-						<p id="creationDateField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_modification_date">Modification
-							Date:</span>
-						<p id="modificationDateField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_creator">Creator:</span>
-						<p id="creatorField">-</p>
-					</div>
-					<div class="separator"></div>
-					<div class="row">
-						<span data-l10n-id="document_properties_producer">PDF
-							Producer:</span>
-						<p id="producerField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_version">PDF
-							Version:</span>
-						<p id="versionField">-</p>
-					</div>
-					<div class="row">
-						<span data-l10n-id="document_properties_page_count">Page
-							Count:</span>
-						<p id="pageCountField">-</p>
-					</div>
-					<div class="buttonRow">
-						<button id="documentPropertiesClose" class="overlayButton">
-							<span data-l10n-id="document_properties_close">Close</span>
-						</button>
-					</div>
-				</div>
-			</div>
+		<div id="toolbarViewerRight">
+			<button id="print" class="toolbarButton" title="打印">
+				<i class="fa fa-print fa-lg" aria-hidden="true"></i>
+			</button>
+			<button id="downloadPdf" class="toolbarButton" title="下载PDF">
+				<i class="fa fa-file-pdf-o fa-lg" aria-hidden="true"></i>
+			</button>
+			<button id="downloadExcel" class="toolbarButton" title="下载Excel">
+				<i class="fa fa-file-excel-o fa-lg" aria-hidden="true"></i>
+			</button>
+			<button id="downloadExcelWithOnlyData" class="toolbarButton"
+				title="下载Excel(仅数据)">
+				<i class="fa fa-file-excel-o fa-lg" aria-hidden="true"></i>
+			</button>
 		</div>
-		<!-- overlayContainer -->
-
 	</div>
-	<!-- outerContainer -->
-	<div id="printContainer"></div>
-	<div id="mozPrintCallback-shim" hidden>
-		<style>
-@media print {
-	#printContainer div {
-		page-break-after: always;
-		page-break-inside: avoid;
-	}
-}
-</style>
-		<style scoped>
-#mozPrintCallback-shim {
-	position: fixed;
-	top: 0;
-	left: 0;
-	height: 100%;
-	width: 100%;
-	z-index: 9999999;
-	display: block;
-	text-align: center;
-	background-color: rgba(0, 0, 0, 0.5);
-}
-
-#mozPrintCallback-shim[hidden] {
-	display: none;
-}
-
-@media print {
-	#mozPrintCallback-shim {
-		display: none;
-	}
-}
-
-#mozPrintCallback-shim .mozPrintCallback-dialog-box {
-	display: inline-block;
-	margin: -50px auto 0;
-	position: relative;
-	top: 45%;
-	left: 0;
-	min-width: 220px;
-	max-width: 400px;
-	padding: 9px;
-	border: 1px solid hsla(0, 0%, 0%, .5);
-	border-radius: 2px;
-	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
-	background-color: #474747;
-	color: hsl(0, 0%, 85%);
-	font-size: 16px;
-	line-height: 20px;
-}
-
-#mozPrintCallback-shim .progress-row {
-	clear: both;
-	padding: 1em 0;
-}
 
-#mozPrintCallback-shim progress {
-	width: 100%;
-}
-
-#mozPrintCallback-shim .relative-progress {
-	clear: both;
-	float: right;
-}
-
-#mozPrintCallback-shim .progress-actions {
-	clear: both;
-}
-</style>
-		<div class="mozPrintCallback-dialog-box">
-			<!-- TODO: Localise the following strings -->
-			正在准备预览文件...
-			<div class="progress-row">
-				<progress value="0" max="100"></progress>
-				<span class="relative-progress">0%</span>
-			</div>
-			<div class="progress-actions">
-				<input type="button" value="Cancel" class="mozPrintCallback-cancel">
-			</div>
-		</div>
+	<div id="viewerContainer">
+		<canvas id="theCanvas"></canvas>
+	</div>
+	<div id="errorMessageContainer" hidden="true">
+		<p id="message"></p>
+		<button id="detailedMessageButton" class="viewerContainerButton"
+			title="获取更多错误信息" hidden="true">更多信息</button>
+		<p id="detailedMessage" hidden="true"></p>
 	</div>
 
-<iframe id="hiddenframe" hidden='true'></iframe>
+	<iframe id="hiddenFrame" hidden="true"></iframe>
 </body>
 
-<script src="static/lib/pdf.js/web/compatibility.js"></script>
-<script src="static/lib/pdf.js/web/l10n.js"></script>
 <script src="static/lib/pdf.js/build/pdf.js"></script>
 <script src="static/lib/jquery/jquery.min.js"></script>
+<script src="static/lib/jquery/ba-tiny-pubsub.min.js"></script>
+<script src="static/lib/spin/spin.min.js"></script>
+<script src="static/js/util/utils.js"></script>
 <script src="static/js/preview/utils.js"></script>
 <script src="static/js/preview/app.js"></script>
-<script src="static/lib/pdf.js/web/debugger.js"></script>
-<script src="static/lib/pdf.js/web/viewer.js"></script>
 </html>
-

+ 0 - 84
src/main/webapp/WEB-INF/views/preview2.html

@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-<title>Preview</title>
-<link rel="stylesheet" href="static/css/preview2.css">
-<link rel="stylesheet"
-	href="static/lib/fontawesome/css/font-awesome.min.css">
-</head>
-<body>
-	<div id="toolbarContainer">
-		<div id="toolbarViewerLeft">
-			<button id="zoomOut" class="toolbarButton" title="缩小">
-				<i class="fa fa-minus fa-lg" aria-hidden="true"></i>
-			</button>
-			<button id="zoomIn" class="toolbarButton" title="放大">
-				<i class="fa fa-plus fa-lg" aria-hidden="true"></i>
-			</button>
-			<label class="select"> <select id="scaleSelect">
-					<option value="auto" selected="selected">自动缩放</option>
-					<option value="page_width">适合页宽</option>
-					<option value="0.25">25%</option>
-					<option value="0.5">50%</option>
-					<option value="0.75">75%</option>
-					<option value="1" title="原始宽度">100%</option>
-					<option value="1.25">125%</option>
-					<option value="1.5">150%</option>
-					<option value="2">200%</option>
-					<option value="3">300%</option>
-					<option value="4">400%</option>
-					<option id="hiddenOption" hidden="true"></option>
-			</select>
-			</label>
-		</div>
-
-		<div id="toobarViewerCenter">
-			<button id="prev" class="toolbarButton" title="上页">
-				<i class="fa fa-arrow-left fa-lg" aria-hidden="true"></i>
-			</button>
-			<span><input id="pageIndex" type="text" /> / <span
-				id="pageSize">0</span></span>
-			<button id="next" class="toolbarButton" title="下页">
-				<i class="fa fa-arrow-right fa-lg" aria-hidden="true"></i>
-			</button>
-		</div>
-
-		<div id="toolbarViewerRight">
-			<button id="print" class="toolbarButton" title="打印">
-				<i class="fa fa-print fa-lg" aria-hidden="true"></i>
-			</button>
-			<button id="downloadPdf" class="toolbarButton" title="下载PDF">
-				<i class="fa fa-file-pdf-o fa-lg" aria-hidden="true"></i>
-			</button>
-			<button id="downloadExcel" class="toolbarButton" title="下载Excel">
-				<i class="fa fa-file-excel-o fa-lg" aria-hidden="true"></i>
-			</button>
-			<button id="downloadExcelWithOnlyData" class="toolbarButton"
-				title="下载Excel(仅数据)">
-				<i class="fa fa-file-excel-o fa-lg" aria-hidden="true"></i>
-			</button>
-		</div>
-	</div>
-
-	<div id="viewerContainer">
-		<canvas id="theCanvas"></canvas>
-	</div>
-	<div id="errorMessageContainer" hidden="true">
-		<p id="message"></p>
-		<button id="detailedMessageButton" class="viewerContainerButton"
-			title="获取更多错误信息" hidden="true">更多信息</button>
-		<p id="detailedMessage" hidden="true"></p>
-	</div>
-
-	<iframe id="hiddenFrame" hidden="true"></iframe>
-</body>
-
-<script src="static/lib/pdf.js/build/pdf.js"></script>
-<script src="static/lib/jquery/jquery.min.js"></script>
-<script src="static/lib/jquery/ba-tiny-pubsub.min.js"></script>
-<script src="static/lib/spin/spin.min.js"></script>
-<script src="static/js/util/utils.js"></script>
-<script src="static/js/preview/utils.js"></script>
-<script src="static/js/preview2/app.js"></script>
-</html>

+ 0 - 1
src/main/webapp/WEB-INF/webmvc.xml

@@ -34,6 +34,5 @@
 	<mvc:view-controller path="/console" view-name="console" />
 	<mvc:view-controller path="/fileUpload" view-name="fileUpload" />
 	<mvc:view-controller path="/preview" view-name="preview" />
-	<mvc:view-controller path="/preview2" view-name="preview2" />
 	<mvc:view-controller path="/files" view-name="files" />
 </beans>

+ 0 - 0
src/main/webapp/resources/css/preview2.css → src/main/webapp/resources/css/preview.css


+ 506 - 24
src/main/webapp/resources/js/preview/app.js

@@ -1,45 +1,527 @@
+//IE下找不到pdf.worker.js,需要手动赋值
+PDFJS.workerSrc = 'static/lib/pdf.js/build/pdf.worker.js';
+
+var canvas = document.getElementById('theCanvas');
+var ctx = canvas.getContext('2d');
 // 隐藏的iframe,用于加载pdf,以便打印(pdf.js自带的打印有问题)
-var hiddenframe = document.getElementById("hiddenframe");
-var PDFData, DEFAULT_URL;
-var pageIndex = 1, pageSize = 1;// 当前页码,页码总数
-loadPdfData();
-// 是否立即打印
+var hiddenFrame = document.getElementById("hiddenFrame");
+// 用于显示正在加载的提示
+var spinner;
+
+// 能打印的最大页数(页数超过,需要先下载pdf,再打印)
+var PRINT_MAX_PAGE_SIZE = 200;
+var ALERT_FILE_TOO_LARGE = "pdf超过" + PRINT_MAX_PAGE_SIZE
+		+ "页,建议先下载到本地,再进行查看或打印";
+var pdfDoc;
+// 页码
+var pageIndex;
+// 总页数
+var pageSize;
+// 预览的pdf的缩放级别(为pdf原大小的倍数)
+var scale;
+// 浏览器窗口高度
+var winHeight;
+// 浏览器窗口宽度
+var winWidth;
+// 将要打印的总的pdf(整个文档,而不是某一页的pdf)相对路径
+var wholePdfPath;
+// 某一页pdf文件的路径
+var pagedPdfPath;
+// 参数打印类型,可能为PRINT、PREVIEW
 var printType = getParameter("printType");
-if (printType && printType == 'PRINT') {
-	hiddenframe.onload = function() {
-		hiddenframe.contentWindow.print();
+// 首次加载页面()
+var firstRequest = true;
+
+getWindowWidth();
+loadData(1);
+
+// 缩小,最小不小于原大小的0.2/1.2倍
+$("#zoomOut").click(function() {
+	if (scale >= 0.2) {
+		scale = scale / 1.2;
+		changeTextOfSelectScale()
+		renderPage();
 	}
-}
+});
 
-$("#print2").click(function() {
-	if (hiddenframe.src) {
-		hiddenframe.contentWindow.print();
-	} else {
-		window.document.write("Hidden pdf iframe did not load");
+// 放大,最大不大于原大小的5*1.2倍
+$("#zoomIn").click(function() {
+	if (scale <= 5) {
+		scale = scale * 1.2;
+		changeTextOfSelectScale()
+		renderPage();
+	}
+});
+
+// 选择缩放倍数
+$("#scaleSelect").change(function() {
+	scale = this.value;
+	renderPage();
+});
+
+// 上页
+$("#prev").click(prevPage);
+
+// 下页
+$("#next").click(nextPage);
+
+// 手动输入页码
+$("#pageIndex").keypress(function(event) {
+	if (!pdfDoc) {
+		return;
+	}
+	// 按Enter键
+	if (event.keyCode == 13) {
+		var value = document.getElementById("pageIndex").value;
+		// 以非0开头的整数
+		var regExp = /^([1-9]+\d*)$/;
+		if (regExp.test(value) && value >= 1 && value <= pageSize) {
+			if (value == pageIndex) {
+				return;
+			}
+			if (pageSize > PRINT_MAX_PAGE_SIZE) {
+				alert(ALERT_FILE_TOO_LARGE);
+				return;
+			}
+			firstRequest = false;
+			pageIndex = value;
+			loadData(pageIndex);
+		} else {
+			document.getElementById("pageIndex").value = pageIndex;
+		}
+	}
+});
+
+// 打印
+$("#print").click(function() {
+	if (!pdfDoc) {
+		return;
 	}
+	printPdf();
 });
-$("#download_pdf").click(function() {
+
+// 下载pdf
+$("#downloadPdf").click(
+		function() {
+			if (!pdfDoc) {
+				return;
+			}
+			console.log(new Date().format()
+					+ " ---- subscribed wholePdfGeneratedSignal");
+			$.subscribe("wholePdfGeneratedSignal", downloadPdf);
+			showLoading();
+			waitWholePdfGenerated();
+		});
+
+/**
+ * 下载文件
+ */
+function downloadPdf() {
+	hideLoading();
+	console.log(new Date().format()
+			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
+	$.unsubscribe("wholePdfGeneratedSignal", downloadPdf);
+	console.log(new Date().format() + " ---- start download...");
 	window.location = downloadUrl("pdf");
+	hiddenFrame.src = wholePdfPath;
+}
+
+// 下载纯数据excel
+$("#downloadExcel").click(function() {
+	if (!pdfDoc) {
+		return;
+	}
+	window.open(downloadUrl("xls"));
 });
 
-$("#download_excel").click(function() {
-	window.location = downloadUrl("xls");
+// 下载纯数据excel
+$("#downloadExcelWithOnlyData").click(function() {
+	if (!pdfDoc) {
+		return;
+	}
+	window.open(downloadUrl("xls_with_only_data"));
 });
 
-$("#download_excel_with_only_data").click(function() {
-	window.location = downloadUrl("xls_with_only_data");
+// 键盘左右键进行翻页
+$("body").keydown(function(event) {
+	// 如果在选中input输入框或select下拉列表时按左右键,不进行翻页
+	var activeElementNodeName = document.activeElement.nodeName.toLowerCase();
+	if (activeElementNodeName == "input" || activeElementNodeName == "select") {
+		return;
+	}
+	if (event.keyCode == 37) {// left
+		prevPage();
+	} else if (event.keyCode == 39) {// right
+		nextPage();
+	}
 });
 
-//获取数据
-function loadPdfData() {
+/**
+ * 获取窗口宽度
+ */
+function getWindowWidth() {
+	if (window.innerWidth)
+		winWidth = window.innerWidth;
+	else if ((document.body) && (document.body.clientWidth))
+		winWidth = document.body.clientWidth;
+	// 获取窗口高度
+	if (window.innerHeight)
+		winHeight = window.innerHeight;
+	else if ((document.body) && (document.body.clientHeight))
+		winHeight = document.body.clientHeight;
+	// 通过深入 Document 内部对 body 进行检测,获取窗口大小
+	if (document.documentElement && document.documentElement.clientHeight
+			&& document.documentElement.clientWidth) {
+		winHeight = document.documentElement.clientHeight;
+		winWidth = document.documentElement.clientWidth;
+	}
+}
+
+/**
+ * 打印
+ */
+function printPdf() {
+	hideLoading();
+	if (pageSize > PRINT_MAX_PAGE_SIZE) {
+		alert(ALERT_FILE_TOO_LARGE);
+		return;
+	}
+	if (!pdfDoc) {
+		return;
+	}
+	console.log(new Date().format()
+			+ " ---- subscribed wholePdfGeneratedSignal");
+	$.subscribe("wholePdfGeneratedSignal", print);
+	showLoading();
+	waitWholePdfGenerated();
+}
+
+/**
+ * 取消订阅信号,打印
+ */
+function print() {
+	console.log(new Date().format()
+			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
+	$.unsubscribe("wholePdfGeneratedSignal", print);
+	console.log(new Date().format() + " ---- start print...");
+	setTimeout("hiddenFrame.contentWindow.print();hideLoading()", 1000);
+}
+
+/**
+ * 获取预览的pdf文档数据,完成后加载整个文档
+ * 
+ * @param pagedPdfPath
+ *            需要进行预览的分页pdf相对路径
+ * @param ifPreloadWholePdf
+ *            渲染之后,是否预加载整个文档
+ */
+function loadPagedPdf(pagedPdfPath, ifPreloadWholePdf) {
+	// var dfd = $.Deferred();
+	PDFJS
+			.getDocument(pagedPdfPath)
+			.then(
+					function(pdfDoc_) {
+						// 更新页码
+						document.getElementById('pageIndex').value = pageIndex;
+						pdfDoc = pdfDoc_;
+						// 第一页文档渲染完成后,再加载整个文档
+						if (ifPreloadWholePdf) {
+							if (printType == 'PRINT'
+									&& pageSize > PRINT_MAX_PAGE_SIZE) {
+								alert(ALERT_FILE_TOO_LARGE);
+								hideLoading();
+							} else {
+								console
+										.log(new Date().format()
+												+ " ---- subscribed wholePdfGeneratedSignal");
+								$.subscribe("wholePdfGeneratedSignal",
+										loadWholePdf);
+								showLoading();
+								waitWholePdfGenerated();
+							}
+						}
+						// Initial/first page rendering
+						renderPage();
+						// $.when(rend("getDocument promised");
+						// dfd.resolve();
+						// });
+					});
+	// return dfd.promise;
+}
+
+/**
+ * 发送请求,服务器端进行填充报表、生成pdf文件等操作
+ */
+function loadData(page) {
+	ctx.clearRect(0, 0, canvas.width, canvas.height);
+	showLoading();
+	pageIndex = page || 1;
 	var loadPdfDataUrl = "print/loadPdfData" + window.location.search;
+	loadPdfDataUrl = loadPdfDataUrl + "&pageIndex=" + pageIndex;
 	$.ajax({
 		type : "get",
 		async : false,
 		url : loadPdfDataUrl,
 		success : function(data) {
-			DEFAULT_URL = data.pdfPath;
-			hiddenframe.src = data.pdfPath;
+			// 返回的pdf文件路径
+			wholePdfPath = data.pdfPath;
+			// 第pageIndex页的pdf文件路径
+			pagedPdfPath = wholePdfPath.replace(".pdf", "_" + pageIndex
+					+ ".pdf");
+			if (firstRequest) {
+				pageSize = data.pageSize;
+				document.getElementById('pageSize').textContent = pageSize;
+				document.title = getParameter("reportName");
+				// 加载第一页文档,并且预加载整个文档
+				loadPagedPdf(pagedPdfPath, true);
+				// $.when(getDocument()).done(loadWholePdf);
+				// console.log(renderTask._internalRenderTask.running);
+			} else {
+				loadPagedPdf(pagedPdfPath);
+			}
+		},
+		error : function(XMLHttpRequest) {
+			$("#theCanvas").remove();
+			hideLoading();
+			$("#errorMessageContainer").removeAttr("hidden");
+
+			// 处理后台传输的自定义的换行标志
+			var result = JSON.parse(XMLHttpRequest.responseText);
+			var message = result.message;
+			$("#message").html(message);
+			if (result.detailedMessage) {
+				$("#detailedMessageButton").removeAttr("hidden");
+			}
+			$("#detailedMessageButton").click(function() {
+				$("#detailedMessage").html(result.detailedMessage);
+				$("#detailedMessage").removeAttr("hidden");
+			});
+		}
+	});
+};
+
+/**
+ * 预加载整个pdf(大于PRINT_MAX_PAGE_SIZE页,不加载)文件,以提高后续打印速度
+ */
+function loadWholePdf() {
+	console.log(new Date().format()
+			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
+	$.unsubscribe("wholePdfGeneratedSignal", loadWholePdf);
+	// 开始加载
+	console.log(new Date().format() + " ---- hiddenFrame loading...");
+	hiddenFrame.src = wholePdfPath;
+	if (printType == "PRINT") {
+		setTimeout("printPdf()", 1000);
+	}
+}
+
+/**
+ * 每隔一定时间查询文件状态,直到文件有效
+ */
+function waitWholePdfGenerated() {
+	var valid = getGeneratedPdfOrXlsInformation("pdf").valid;
+	if (!valid) {
+		console.log(new Date().format() + " ---- 文件还未生成");
+		console.log(new Date().format() + " ---- wait 1000ms")
+		setTimeout("waitWholePdfGenerated()", 1000);
+	} else {
+		console.log(new Date().format() + " ---- 文件已生成");
+		console.log(new Date().format()
+				+ " ---- published wholePdfGeneratedSignal");
+		$.publish("wholePdfGeneratedSignal", waitWholePdfGenerated);
+	}
+}
+
+/**
+ * 获取生成的pdf或者xls的信息
+ * 
+ * @param fileType
+ *            文件格式,pdf、xls、xls_with_only_data
+ */
+function getGeneratedPdfOrXlsInformation(fileType) {
+	var data;
+	$.ajax({
+		type : "get",
+		async : false,
+		url : "print/getGeneratedPdfOrXlsInformation" + window.location.search
+				+ "&fileType=" + fileType,
+		success : function(result) {
+			console
+					.log(new Date().format() + " ---- "
+							+ JSON.stringify(result));
+			data = result;
 		}
 	});
-};
+	return data;
+}
+
+/**
+ * Get page info from document, resize canvas accordingly, and render page
+ */
+function renderPage() {
+	hideLoading();
+	if (firstRequest && printType == "PRINT" && pageSize <= PRINT_MAX_PAGE_SIZE) {
+		showLoading();
+	}
+	if (!pdfDoc) {
+		return;
+	}
+	// 每个pdf只有一页
+	pdfDoc
+			.getPage(1)
+			.then(
+					function(page) {
+						if (!scale || scale == "auto") {
+							// 调整为适合的宽度
+							scale = getScale(page, 0.75);
+						} else if (scale == "page_width") {
+							// 调整pdf显示的宽度接近窗口宽度
+							scale = getScale(page, 0.95);
+						}
+						var viewport = page.getViewport(scale);
+						canvas.height = viewport.height;
+						canvas.width = viewport.width;
+						// Render PDF page into canvas context
+						var renderContext = {
+							canvasContext : ctx,
+							viewport : viewport
+						};
+						// 开始渲染
+						var renderTask = page.render(renderContext);
+						$
+								.when(renderTask)
+								.done(
+										function() {
+											// 渲染完成后,发布信号
+											// "renderTaskFinishedSignal"
+											console
+													.log(new Date().format()
+															+ " ---- renderTask finished");
+											console
+													.log(new Date().format()
+															+ " ---- publish renderTaskFinishedSignal");
+											$
+													.publish("renderTaskFinishedSignal");
+											// var renderTaskRunning =
+											// renderTask._internalRenderTask.running;
+											// return !renderTaskRunning;
+										});
+					});
+}
+
+/**
+ * 获取缩放级别(将pdf显示的宽度调整为窗口宽度的multipleOfWindowWidth倍,获取该情况下pdf宽度为原宽度的倍数)
+ * 
+ * @param page
+ *            pdf数据
+ * @param multipleOfWindowWidth
+ *            窗口宽度的倍数
+ * @returns {Number} 缩放级别(pdf原宽度的倍数)
+ */
+function getScale(page, multipleOfWindowWidth) {
+	// 首先获取pdf原始宽度
+	var viewportWidth = page.getViewport(1).width;
+	return multipleOfWindowWidth / (viewportWidth / winWidth);
+}
+
+/**
+ * 预览前一页
+ */
+function prevPage() {
+	// 验证pdfDoc不存在,是为了避免报表出现编译失败等问题时,仍然试图翻页
+	if (!pdfDoc || pageIndex <= 1) {
+		return;
+	}
+	// 获取前一页的pdf
+	pageIndex--;
+	loadData(pageIndex);
+}
+
+/**
+ * 预览后一页
+ */
+function nextPage() {
+	if (!pdfDoc || pageIndex >= pageSize) {
+		return;
+	}
+	if (pageSize > PRINT_MAX_PAGE_SIZE) {
+		alert(ALERT_FILE_TOO_LARGE);
+		return;
+	}
+	firstRequest = false;
+	pageIndex++;
+	loadData(pageIndex);
+}
+
+/**
+ * 修改缩放下拉框所显示的内容
+ */
+function changeTextOfSelectScale() {
+	var hiddenOption = document.getElementById("hiddenOption");
+	hiddenOption.removeAttribute("hidden");
+	hiddenOption.text = (scale * 100).toFixed() + "%";
+	hiddenOption.selected = true;
+	hiddenOption.hidden = true;
+}
+
+/**
+ * 显示正在载入的动画
+ */
+function showLoading() {
+	if (spinner) {
+		return;
+	}
+	var opts = {
+		lines : 9 // The number of lines to draw
+		,
+		length : 17 // The length of each line
+		,
+		width : 10 // The line thickness
+		,
+		radius : 26 // The radius of the inner circle
+		,
+		scale : 1 // Scales overall size of the spinner
+		,
+		corners : 1 // Corner roundness (0..1)
+		,
+		color : '#000' // #rgb or #rrggbb or array of colors
+		,
+		opacity : 0.5 // Opacity of the lines
+		,
+		rotate : 0 // The rotation offset
+		,
+		direction : 1 // 1: clockwise, -1: counterclockwise
+		,
+		speed : 1 // Rounds per second
+		,
+		trail : 60 // Afterglow percentage
+		,
+		fps : 20 // Frames per second when using setTimeout() as a fallback
+		// for CSS
+		,
+		zIndex : 2e9 // The z-index (defaults to 2000000000)
+		,
+		className : 'spinner' // The CSS class to assign to the spinner
+		,
+		top : '50%' // Top position relative to parent
+		,
+		left : '50%' // Left position relative to parent
+		,
+		shadow : false // Whether to render a shadow
+		,
+		hwaccel : false // Whether to use hardware acceleration
+		,
+		position : 'absolute' // Element positioning
+	}
+	var target = document.getElementById('viewerContainer');
+	spinner = new Spinner(opts).spin(target);
+}
+/**
+ * 关闭正在载入的动画
+ */
+function hideLoading() {
+	if (spinner) {
+		spinner.stop();
+		spinner = null;
+	}
+}

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

@@ -1,527 +0,0 @@
-//IE下找不到pdf.worker.js,需要手动赋值
-PDFJS.workerSrc = 'static/lib/pdf.js/build/pdf.worker.js';
-
-var canvas = document.getElementById('theCanvas');
-var ctx = canvas.getContext('2d');
-// 隐藏的iframe,用于加载pdf,以便打印(pdf.js自带的打印有问题)
-var hiddenFrame = document.getElementById("hiddenFrame");
-// 用于显示正在加载的提示
-var spinner;
-
-// 能打印的最大页数(页数超过,需要先下载pdf,再打印)
-var PRINT_MAX_PAGE_SIZE = 200;
-var ALERT_FILE_TOO_LARGE = "pdf超过" + PRINT_MAX_PAGE_SIZE
-		+ "页,建议先下载到本地,再进行查看或打印";
-var pdfDoc;
-// 页码
-var pageIndex;
-// 总页数
-var pageSize;
-// 预览的pdf的缩放级别(为pdf原大小的倍数)
-var scale;
-// 浏览器窗口高度
-var winHeight;
-// 浏览器窗口宽度
-var winWidth;
-// 将要打印的总的pdf(整个文档,而不是某一页的pdf)相对路径
-var wholePdfPath;
-// 某一页pdf文件的路径
-var pagedPdfPath;
-// 参数打印类型,可能为PRINT、PREVIEW
-var printType = getParameter("printType");
-// 首次加载页面()
-var firstRequest = true;
-
-getWindowWidth();
-loadData(1);
-
-// 缩小,最小不小于原大小的0.2/1.2倍
-$("#zoomOut").click(function() {
-	if (scale >= 0.2) {
-		scale = scale / 1.2;
-		changeTextOfSelectScale()
-		renderPage();
-	}
-});
-
-// 放大,最大不大于原大小的5*1.2倍
-$("#zoomIn").click(function() {
-	if (scale <= 5) {
-		scale = scale * 1.2;
-		changeTextOfSelectScale()
-		renderPage();
-	}
-});
-
-// 选择缩放倍数
-$("#scaleSelect").change(function() {
-	scale = this.value;
-	renderPage();
-});
-
-// 上页
-$("#prev").click(prevPage);
-
-// 下页
-$("#next").click(nextPage);
-
-// 手动输入页码
-$("#pageIndex").keypress(function(event) {
-	if (!pdfDoc) {
-		return;
-	}
-	// 按Enter键
-	if (event.keyCode == 13) {
-		var value = document.getElementById("pageIndex").value;
-		// 以非0开头的整数
-		var regExp = /^([1-9]+\d*)$/;
-		if (regExp.test(value) && value >= 1 && value <= pageSize) {
-			if (value == pageIndex) {
-				return;
-			}
-			if (pageSize > PRINT_MAX_PAGE_SIZE) {
-				alert(ALERT_FILE_TOO_LARGE);
-				return;
-			}
-			firstRequest = false;
-			pageIndex = value;
-			loadData(pageIndex);
-		} else {
-			document.getElementById("pageIndex").value = pageIndex;
-		}
-	}
-});
-
-// 打印
-$("#print").click(function() {
-	if (!pdfDoc) {
-		return;
-	}
-	printPdf();
-});
-
-// 下载pdf
-$("#downloadPdf").click(
-		function() {
-			if (!pdfDoc) {
-				return;
-			}
-			console.log(new Date().format()
-					+ " ---- subscribed wholePdfGeneratedSignal");
-			$.subscribe("wholePdfGeneratedSignal", downloadPdf);
-			showLoading();
-			waitWholePdfGenerated();
-		});
-
-/**
- * 下载文件
- */
-function downloadPdf() {
-	hideLoading();
-	console.log(new Date().format()
-			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
-	$.unsubscribe("wholePdfGeneratedSignal", downloadPdf);
-	console.log(new Date().format() + " ---- start download...");
-	window.location = downloadUrl("pdf");
-	hiddenFrame.src = wholePdfPath;
-}
-
-// 下载纯数据excel
-$("#downloadExcel").click(function() {
-	if (!pdfDoc) {
-		return;
-	}
-	window.open(downloadUrl("xls"));
-});
-
-// 下载纯数据excel
-$("#downloadExcelWithOnlyData").click(function() {
-	if (!pdfDoc) {
-		return;
-	}
-	window.open(downloadUrl("xls_with_only_data"));
-});
-
-// 键盘左右键进行翻页
-$("body").keydown(function(event) {
-	// 如果在选中input输入框或select下拉列表时按左右键,不进行翻页
-	var activeElementNodeName = document.activeElement.nodeName.toLowerCase();
-	if (activeElementNodeName == "input" || activeElementNodeName == "select") {
-		return;
-	}
-	if (event.keyCode == 37) {// left
-		prevPage();
-	} else if (event.keyCode == 39) {// right
-		nextPage();
-	}
-});
-
-/**
- * 获取窗口宽度
- */
-function getWindowWidth() {
-	if (window.innerWidth)
-		winWidth = window.innerWidth;
-	else if ((document.body) && (document.body.clientWidth))
-		winWidth = document.body.clientWidth;
-	// 获取窗口高度
-	if (window.innerHeight)
-		winHeight = window.innerHeight;
-	else if ((document.body) && (document.body.clientHeight))
-		winHeight = document.body.clientHeight;
-	// 通过深入 Document 内部对 body 进行检测,获取窗口大小
-	if (document.documentElement && document.documentElement.clientHeight
-			&& document.documentElement.clientWidth) {
-		winHeight = document.documentElement.clientHeight;
-		winWidth = document.documentElement.clientWidth;
-	}
-}
-
-/**
- * 打印
- */
-function printPdf() {
-	hideLoading();
-	if (pageSize > PRINT_MAX_PAGE_SIZE) {
-		alert(ALERT_FILE_TOO_LARGE);
-		return;
-	}
-	if (!pdfDoc) {
-		return;
-	}
-	console.log(new Date().format()
-			+ " ---- subscribed wholePdfGeneratedSignal");
-	$.subscribe("wholePdfGeneratedSignal", print);
-	showLoading();
-	waitWholePdfGenerated();
-}
-
-/**
- * 取消订阅信号,打印
- */
-function print() {
-	console.log(new Date().format()
-			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
-	$.unsubscribe("wholePdfGeneratedSignal", print);
-	console.log(new Date().format() + " ---- start print...");
-	setTimeout("hiddenFrame.contentWindow.print();hideLoading()", 1000);
-}
-
-/**
- * 获取预览的pdf文档数据,完成后加载整个文档
- * 
- * @param pagedPdfPath
- *            需要进行预览的分页pdf相对路径
- * @param ifPreloadWholePdf
- *            渲染之后,是否预加载整个文档
- */
-function loadPagedPdf(pagedPdfPath, ifPreloadWholePdf) {
-	// var dfd = $.Deferred();
-	PDFJS
-			.getDocument(pagedPdfPath)
-			.then(
-					function(pdfDoc_) {
-						// 更新页码
-						document.getElementById('pageIndex').value = pageIndex;
-						pdfDoc = pdfDoc_;
-						// 第一页文档渲染完成后,再加载整个文档
-						if (ifPreloadWholePdf) {
-							if (printType == 'PRINT'
-									&& pageSize > PRINT_MAX_PAGE_SIZE) {
-								alert(ALERT_FILE_TOO_LARGE);
-								hideLoading();
-							} else {
-								console
-										.log(new Date().format()
-												+ " ---- subscribed wholePdfGeneratedSignal");
-								$.subscribe("wholePdfGeneratedSignal",
-										loadWholePdf);
-								showLoading();
-								waitWholePdfGenerated();
-							}
-						}
-						// Initial/first page rendering
-						renderPage();
-						// $.when(rend("getDocument promised");
-						// dfd.resolve();
-						// });
-					});
-	// return dfd.promise;
-}
-
-/**
- * 发送请求,服务器端进行填充报表、生成pdf文件等操作
- */
-function loadData(page) {
-	ctx.clearRect(0, 0, canvas.width, canvas.height);
-	showLoading();
-	pageIndex = page || 1;
-	var loadPdfDataUrl = "print/loadPdfData" + window.location.search;
-	loadPdfDataUrl = loadPdfDataUrl + "&pageIndex=" + pageIndex;
-	$.ajax({
-		type : "get",
-		async : false,
-		url : loadPdfDataUrl,
-		success : function(data) {
-			// 返回的pdf文件路径
-			wholePdfPath = data.pdfPath;
-			// 第pageIndex页的pdf文件路径
-			pagedPdfPath = wholePdfPath.replace(".pdf", "_" + pageIndex
-					+ ".pdf");
-			if (firstRequest) {
-				pageSize = data.pageSize;
-				document.getElementById('pageSize').textContent = pageSize;
-				document.title = getParameter("reportName");
-				// 加载第一页文档,并且预加载整个文档
-				loadPagedPdf(pagedPdfPath, true);
-				// $.when(getDocument()).done(loadWholePdf);
-				// console.log(renderTask._internalRenderTask.running);
-			} else {
-				loadPagedPdf(pagedPdfPath);
-			}
-		},
-		error : function(XMLHttpRequest) {
-			$("#theCanvas").remove();
-			hideLoading();
-			$("#errorMessageContainer").removeAttr("hidden");
-
-			// 处理后台传输的自定义的换行标志
-			var result = JSON.parse(XMLHttpRequest.responseText);
-			var message = result.message;
-			$("#message").html(message);
-			if (result.detailedMessage) {
-				$("#detailedMessageButton").removeAttr("hidden");
-			}
-			$("#detailedMessageButton").click(function() {
-				$("#detailedMessage").html(result.detailedMessage);
-				$("#detailedMessage").removeAttr("hidden");
-			});
-		}
-	});
-};
-
-/**
- * 预加载整个pdf(大于PRINT_MAX_PAGE_SIZE页,不加载)文件,以提高后续打印速度
- */
-function loadWholePdf() {
-	console.log(new Date().format()
-			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
-	$.unsubscribe("wholePdfGeneratedSignal", loadWholePdf);
-	// 开始加载
-	console.log(new Date().format() + " ---- hiddenFrame loading...");
-	hiddenFrame.src = wholePdfPath;
-	if (printType == "PRINT") {
-		setTimeout("printPdf()", 1000);
-	}
-}
-
-/**
- * 每隔一定时间查询文件状态,直到文件有效
- */
-function waitWholePdfGenerated() {
-	var valid = getGeneratedPdfOrXlsInformation("pdf").valid;
-	if (!valid) {
-		console.log(new Date().format() + " ---- 文件还未生成");
-		console.log(new Date().format() + " ---- wait 1000ms")
-		setTimeout("waitWholePdfGenerated()", 1000);
-	} else {
-		console.log(new Date().format() + " ---- 文件已生成");
-		console.log(new Date().format()
-				+ " ---- published wholePdfGeneratedSignal");
-		$.publish("wholePdfGeneratedSignal", waitWholePdfGenerated);
-	}
-}
-
-/**
- * 获取生成的pdf或者xls的信息
- * 
- * @param fileType
- *            文件格式,pdf、xls、xls_with_only_data
- */
-function getGeneratedPdfOrXlsInformation(fileType) {
-	var data;
-	$.ajax({
-		type : "get",
-		async : false,
-		url : "print/getGeneratedPdfOrXlsInformation" + window.location.search
-				+ "&fileType=" + fileType,
-		success : function(result) {
-			console
-					.log(new Date().format() + " ---- "
-							+ JSON.stringify(result));
-			data = result;
-		}
-	});
-	return data;
-}
-
-/**
- * Get page info from document, resize canvas accordingly, and render page
- */
-function renderPage() {
-	hideLoading();
-	if (firstRequest && printType == "PRINT" && pageSize <= PRINT_MAX_PAGE_SIZE) {
-		showLoading();
-	}
-	if (!pdfDoc) {
-		return;
-	}
-	// 每个pdf只有一页
-	pdfDoc
-			.getPage(1)
-			.then(
-					function(page) {
-						if (!scale || scale == "auto") {
-							// 调整为适合的宽度
-							scale = getScale(page, 0.75);
-						} else if (scale == "page_width") {
-							// 调整pdf显示的宽度接近窗口宽度
-							scale = getScale(page, 0.95);
-						}
-						var viewport = page.getViewport(scale);
-						canvas.height = viewport.height;
-						canvas.width = viewport.width;
-						// Render PDF page into canvas context
-						var renderContext = {
-							canvasContext : ctx,
-							viewport : viewport
-						};
-						// 开始渲染
-						var renderTask = page.render(renderContext);
-						$
-								.when(renderTask)
-								.done(
-										function() {
-											// 渲染完成后,发布信号
-											// "renderTaskFinishedSignal"
-											console
-													.log(new Date().format()
-															+ " ---- renderTask finished");
-											console
-													.log(new Date().format()
-															+ " ---- publish renderTaskFinishedSignal");
-											$
-													.publish("renderTaskFinishedSignal");
-											// var renderTaskRunning =
-											// renderTask._internalRenderTask.running;
-											// return !renderTaskRunning;
-										});
-					});
-}
-
-/**
- * 获取缩放级别(将pdf显示的宽度调整为窗口宽度的multipleOfWindowWidth倍,获取该情况下pdf宽度为原宽度的倍数)
- * 
- * @param page
- *            pdf数据
- * @param multipleOfWindowWidth
- *            窗口宽度的倍数
- * @returns {Number} 缩放级别(pdf原宽度的倍数)
- */
-function getScale(page, multipleOfWindowWidth) {
-	// 首先获取pdf原始宽度
-	var viewportWidth = page.getViewport(1).width;
-	return multipleOfWindowWidth / (viewportWidth / winWidth);
-}
-
-/**
- * 预览前一页
- */
-function prevPage() {
-	// 验证pdfDoc不存在,是为了避免报表出现编译失败等问题时,仍然试图翻页
-	if (!pdfDoc || pageIndex <= 1) {
-		return;
-	}
-	// 获取前一页的pdf
-	pageIndex--;
-	loadData(pageIndex);
-}
-
-/**
- * 预览后一页
- */
-function nextPage() {
-	if (!pdfDoc || pageIndex >= pageSize) {
-		return;
-	}
-	if (pageSize > PRINT_MAX_PAGE_SIZE) {
-		alert(ALERT_FILE_TOO_LARGE);
-		return;
-	}
-	firstRequest = false;
-	pageIndex++;
-	loadData(pageIndex);
-}
-
-/**
- * 修改缩放下拉框所显示的内容
- */
-function changeTextOfSelectScale() {
-	var hiddenOption = document.getElementById("hiddenOption");
-	hiddenOption.removeAttribute("hidden");
-	hiddenOption.text = (scale * 100).toFixed() + "%";
-	hiddenOption.selected = true;
-	hiddenOption.hidden = true;
-}
-
-/**
- * 显示正在载入的动画
- */
-function showLoading() {
-	if (spinner) {
-		return;
-	}
-	var opts = {
-		lines : 9 // The number of lines to draw
-		,
-		length : 17 // The length of each line
-		,
-		width : 10 // The line thickness
-		,
-		radius : 26 // The radius of the inner circle
-		,
-		scale : 1 // Scales overall size of the spinner
-		,
-		corners : 1 // Corner roundness (0..1)
-		,
-		color : '#000' // #rgb or #rrggbb or array of colors
-		,
-		opacity : 0.5 // Opacity of the lines
-		,
-		rotate : 0 // The rotation offset
-		,
-		direction : 1 // 1: clockwise, -1: counterclockwise
-		,
-		speed : 1 // Rounds per second
-		,
-		trail : 60 // Afterglow percentage
-		,
-		fps : 20 // Frames per second when using setTimeout() as a fallback
-		// for CSS
-		,
-		zIndex : 2e9 // The z-index (defaults to 2000000000)
-		,
-		className : 'spinner' // The CSS class to assign to the spinner
-		,
-		top : '50%' // Top position relative to parent
-		,
-		left : '50%' // Left position relative to parent
-		,
-		shadow : false // Whether to render a shadow
-		,
-		hwaccel : false // Whether to use hardware acceleration
-		,
-		position : 'absolute' // Element positioning
-	}
-	var target = document.getElementById('viewerContainer');
-	spinner = new Spinner(opts).spin(target);
-}
-/**
- * 关闭正在载入的动画
- */
-function hideLoading() {
-	if (spinner) {
-		spinner.stop();
-		spinner = null;
-	}
-}

BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78ms-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/78ms-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/83pv-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90ms-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90ms-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90msp-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90msp-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90pv-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/90pv-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Add-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-0.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-1.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-3.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-4.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-5.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-6.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-CNS1-UCS2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-0.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-1.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-3.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-4.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-5.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-GB1-UCS2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-0.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-1.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-3.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-4.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-5.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-6.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Japan1-UCS2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-0.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-1.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Adobe-Korea1-UCS2.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/B5-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/B5-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/B5pc-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/B5pc-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS1-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS1-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS2-H.bcmap


+ 0 - 3
src/main/webapp/resources/lib/pdf.js/web/cmaps/CNS2-V.bcmap

@@ -1,3 +0,0 @@
-àRCopyright 1990-2009 Adobe Systems Incorporated.
-All rights reserved.
-See ./LICENSEáCNS2-H

BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETHK-B5-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETHK-B5-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETen-B5-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETen-B5-V.bcmap


+ 0 - 3
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETenms-B5-H.bcmap

@@ -1,3 +0,0 @@
-àRCopyright 1990-2009 Adobe Systems Incorporated.
-All rights reserved.
-See ./LICENSEá	ETen-B5-H` ^

BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/ETenms-B5-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-RKSJ-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-RKSJ-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/Ext-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-EUC-V.bcmap


+ 0 - 4
src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-H.bcmap

@@ -1,4 +0,0 @@
-àRCopyright 1990-2009 Adobe Systems Incorporated.
-All rights reserved.
-See ./LICENSE!!�º]aX!!]`�21�>	�p�z�$]‚�"R‚d�-Uƒ7�*„
4„%�+ „Z „{�/…%…<�9K…b�1]†.�"‡‰`]‡,�"]ˆ
-�"]ˆh�"]‰F�"]Š$�"]‹�"]‹`�"]Œ>�"]��"]�z�"]ŽX�"]�6�"]��"]�r�"]‘P�"]’.�"]“�"]“j�"]”H�"]•&�"]–�"]–b�"]—@�"]˜�"]˜|�"]™Z�"]š8�"]›�"]›t�"]œR�"]�0�"]ž�"]žl�"]ŸJ�"] (�"]¡�"]¡d�"]¢B�"]£ �"X£~�']¤W�"]¥5�"]¦�"]¦q�"]§O�"]¨-�"]©�"]©i�"]ªG�"]«%�"]¬�"]¬a�"]­?�"]®�"]®{�"]¯Y�"]°7�"]±�"]±s�"]²Q�"]³/�"]´
�"]´k�"]µI�"]¶'�"]·�"]·c�"]¸A�"]¹�"]¹}�"]º[�"]»9

BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GB-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK2K-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBK2K-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBKp-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBKp-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBT-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBTpc-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBTpc-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBpc-EUC-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/GBpc-EUC-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdla-B5-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdla-B5-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdlb-B5-H.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/HKdlb-B5-V.bcmap


BIN
src/main/webapp/resources/lib/pdf.js/web/cmaps/HKgccs-B5-H.bcmap


Некоторые файлы не были показаны из-за большого количества измененных файлов