viewer.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright 2012 Mozilla Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. Adobe CMap resources are covered by their own copyright but the same license:
  14. Copyright 1990-2015 Adobe Systems Incorporated.
  15. See https://github.com/adobe-type-tools/cmap-resources
  16. -->
  17. <html dir="ltr" mozdisallowselectionprint moznomarginboxes>
  18. <head>
  19. <meta charset="utf-8">
  20. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  21. <meta name="google" content="notranslate">
  22. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  23. <title>PDF.js viewer</title>
  24. <link rel="stylesheet" href="viewer.css"/>
  25. <script src="compatibility.js"></script>
  26. <!-- This snippet is used in production (included from viewer.html) -->
  27. <script src="../build/pdf.js"></script>
  28. <script src="debugger.js"></script>
  29. <script src="viewer.js"></script>
  30. </head>
  31. <body tabindex="1" class="loadingInProgress">
  32. <div id="outerContainer">
  33. <div id="sidebarContainer">
  34. <div id="toolbarSidebar">
  35. <div class="splitToolbarButton toggled">
  36. <button id="viewThumbnail" class="toolbarButton group toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
  37. <span data-l10n-id="thumbs_label">Thumbnails</span>
  38. </button>
  39. <button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
  40. <span data-l10n-id="outline_label">Document Outline</span>
  41. </button>
  42. <button id="viewAttachments" class="toolbarButton group" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
  43. <span data-l10n-id="attachments_label">Attachments</span>
  44. </button>
  45. </div>
  46. </div>
  47. <div id="sidebarContent">
  48. <div id="thumbnailView">
  49. </div>
  50. <div id="outlineView" class="hidden">
  51. </div>
  52. <div id="attachmentsView" class="hidden">
  53. </div>
  54. </div>
  55. </div> <!-- sidebarContainer -->
  56. <div id="mainContainer">
  57. <div class="findbar hidden doorHanger hiddenSmallView" id="findbar">
  58. <label for="findInput" class="toolbarLabel" data-l10n-id="find_label">Find:</label>
  59. <input id="findInput" class="toolbarField" tabindex="91">
  60. <div class="splitToolbarButton">
  61. <button class="toolbarButton findPrevious" title="" id="findPrevious" tabindex="92" data-l10n-id="find_previous">
  62. <span data-l10n-id="find_previous_label">Previous</span>
  63. </button>
  64. <div class="splitToolbarButtonSeparator"></div>
  65. <button class="toolbarButton findNext" title="" id="findNext" tabindex="93" data-l10n-id="find_next">
  66. <span data-l10n-id="find_next_label">Next</span>
  67. </button>
  68. </div>
  69. <input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
  70. <label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
  71. <input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
  72. <label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
  73. <span id="findResultsCount" class="toolbarLabel hidden"></span>
  74. <span id="findMsg" class="toolbarLabel"></span>
  75. </div> <!-- findbar -->
  76. <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
  77. <div id="secondaryToolbarButtonContainer">
  78. <button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
  79. <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
  80. </button>
  81. <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
  82. <span data-l10n-id="open_file_label">Open</span>
  83. </button>
  84. <button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
  85. <span data-l10n-id="print_label">Print</span>
  86. </button>
  87. <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
  88. <span data-l10n-id="download_label">Download</span>
  89. </button>
  90. <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
  91. <span data-l10n-id="bookmark_label">Current View</span>
  92. </a>
  93. <div class="horizontalToolbarSeparator visibleLargeView"></div>
  94. <button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
  95. <span data-l10n-id="first_page_label">Go to First Page</span>
  96. </button>
  97. <button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="57" data-l10n-id="last_page">
  98. <span data-l10n-id="last_page_label">Go to Last Page</span>
  99. </button>
  100. <div class="horizontalToolbarSeparator"></div>
  101. <button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw">
  102. <span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
  103. </button>
  104. <button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw">
  105. <span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
  106. </button>
  107. <div class="horizontalToolbarSeparator"></div>
  108. <button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="60" data-l10n-id="hand_tool_enable">
  109. <span data-l10n-id="hand_tool_enable_label">Enable hand tool</span>
  110. </button>
  111. <div class="horizontalToolbarSeparator"></div>
  112. <button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="61" data-l10n-id="document_properties">
  113. <span data-l10n-id="document_properties_label">Document Properties…</span>
  114. </button>
  115. </div>
  116. </div> <!-- secondaryToolbar -->
  117. <div class="toolbar">
  118. <div id="toolbarContainer">
  119. <div id="toolbarViewer">
  120. <div id="toolbarViewerLeft">
  121. <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar">
  122. <span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
  123. </button>
  124. <div class="toolbarButtonSpacer"></div>
  125. <button id="viewFind" class="toolbarButton group hiddenSmallView" title="Find in Document" tabindex="12" data-l10n-id="findbar">
  126. <span data-l10n-id="findbar_label">Find</span>
  127. </button>
  128. <div class="splitToolbarButton">
  129. <button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
  130. <span data-l10n-id="previous_label">Previous</span>
  131. </button>
  132. <div class="splitToolbarButtonSeparator"></div>
  133. <button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next">
  134. <span data-l10n-id="next_label">Next</span>
  135. </button>
  136. </div>
  137. <label id="pageNumberLabel" class="toolbarLabel" for="pageNumber" data-l10n-id="page_label">Page: </label>
  138. <input type="number" id="pageNumber" class="toolbarField pageNumber" value="1" size="4" min="1" tabindex="15">
  139. <span id="numPages" class="toolbarLabel"></span>
  140. </div>
  141. <div id="toolbarViewerRight">
  142. <button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">
  143. <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
  144. </button>
  145. <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
  146. <span data-l10n-id="open_file_label">Open</span>
  147. </button>
  148. <button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
  149. <span data-l10n-id="print_label">Print</span>
  150. </button>
  151. <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
  152. <span data-l10n-id="download_label">Download</span>
  153. </button>
  154. <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
  155. <span data-l10n-id="bookmark_label">Current View</span>
  156. </a>
  157. <div class="verticalToolbarSeparator hiddenSmallView"></div>
  158. <button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="36" data-l10n-id="tools">
  159. <span data-l10n-id="tools_label">Tools</span>
  160. </button>
  161. </div>
  162. <div class="outerCenter">
  163. <div class="innerCenter" id="toolbarViewerMiddle">
  164. <div class="splitToolbarButton">
  165. <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">
  166. <span data-l10n-id="zoom_out_label">Zoom Out</span>
  167. </button>
  168. <div class="splitToolbarButtonSeparator"></div>
  169. <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in">
  170. <span data-l10n-id="zoom_in_label">Zoom In</span>
  171. </button>
  172. </div>
  173. <span id="scaleSelectContainer" class="dropdownToolbarButton">
  174. <select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
  175. <option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
  176. <option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
  177. <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
  178. <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
  179. <option id="customScaleOption" title="" value="custom"></option>
  180. <option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
  181. <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
  182. <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
  183. <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
  184. <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
  185. <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>
  186. <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option>
  187. <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option>
  188. </select>
  189. </span>
  190. </div>
  191. </div>
  192. </div>
  193. <div id="loadingBar">
  194. <div class="progress">
  195. <div class="glimmer">
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <menu type="context" id="viewerContextMenu">
  202. <menuitem id="contextFirstPage" label="First Page"
  203. data-l10n-id="first_page"></menuitem>
  204. <menuitem id="contextLastPage" label="Last Page"
  205. data-l10n-id="last_page"></menuitem>
  206. <menuitem id="contextPageRotateCw" label="Rotate Clockwise"
  207. data-l10n-id="page_rotate_cw"></menuitem>
  208. <menuitem id="contextPageRotateCcw" label="Rotate Counter-Clockwise"
  209. data-l10n-id="page_rotate_ccw"></menuitem>
  210. </menu>
  211. <div id="viewerContainer" tabindex="0">
  212. <div id="viewer" class="pdfViewer"></div>
  213. </div>
  214. <div id="errorWrapper" hidden='true'>
  215. <div id="errorMessageLeft">
  216. <span id="errorMessage"></span>
  217. <button id="errorShowMore" data-l10n-id="error_more_info">
  218. More Information
  219. </button>
  220. <button id="errorShowLess" data-l10n-id="error_less_info" hidden='true'>
  221. Less Information
  222. </button>
  223. </div>
  224. <div id="errorMessageRight">
  225. <button id="errorClose" data-l10n-id="error_close">
  226. Close
  227. </button>
  228. </div>
  229. <div class="clearBoth"></div>
  230. <textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea>
  231. </div>
  232. </div> <!-- mainContainer -->
  233. <div id="overlayContainer" class="hidden">
  234. <div id="passwordOverlay" class="container hidden">
  235. <div class="dialog">
  236. <div class="row">
  237. <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
  238. </div>
  239. <div class="row">
  240. <!-- The type="password" attribute is set via script, to prevent warnings in Firefox for all http:// documents. -->
  241. <input id="password" class="toolbarField" />
  242. </div>
  243. <div class="buttonRow">
  244. <button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>
  245. <button id="passwordSubmit" class="overlayButton"><span data-l10n-id="password_ok">OK</span></button>
  246. </div>
  247. </div>
  248. </div>
  249. <div id="documentPropertiesOverlay" class="container hidden">
  250. <div class="dialog">
  251. <div class="row">
  252. <span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p>
  253. </div>
  254. <div class="row">
  255. <span data-l10n-id="document_properties_file_size">File size:</span> <p id="fileSizeField">-</p>
  256. </div>
  257. <div class="separator"></div>
  258. <div class="row">
  259. <span data-l10n-id="document_properties_title">Title:</span> <p id="titleField">-</p>
  260. </div>
  261. <div class="row">
  262. <span data-l10n-id="document_properties_author">Author:</span> <p id="authorField">-</p>
  263. </div>
  264. <div class="row">
  265. <span data-l10n-id="document_properties_subject">Subject:</span> <p id="subjectField">-</p>
  266. </div>
  267. <div class="row">
  268. <span data-l10n-id="document_properties_keywords">Keywords:</span> <p id="keywordsField">-</p>
  269. </div>
  270. <div class="row">
  271. <span data-l10n-id="document_properties_creation_date">Creation Date:</span> <p id="creationDateField">-</p>
  272. </div>
  273. <div class="row">
  274. <span data-l10n-id="document_properties_modification_date">Modification Date:</span> <p id="modificationDateField">-</p>
  275. </div>
  276. <div class="row">
  277. <span data-l10n-id="document_properties_creator">Creator:</span> <p id="creatorField">-</p>
  278. </div>
  279. <div class="separator"></div>
  280. <div class="row">
  281. <span data-l10n-id="document_properties_producer">PDF Producer:</span> <p id="producerField">-</p>
  282. </div>
  283. <div class="row">
  284. <span data-l10n-id="document_properties_version">PDF Version:</span> <p id="versionField">-</p>
  285. </div>
  286. <div class="row">
  287. <span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
  288. </div>
  289. <div class="buttonRow">
  290. <button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
  291. </div>
  292. </div>
  293. </div>
  294. </div> <!-- overlayContainer -->
  295. </div> <!-- outerContainer -->
  296. <div id="printContainer"></div>
  297. <div id="mozPrintCallback-shim" hidden>
  298. <style>
  299. @media print {
  300. #printContainer div {
  301. page-break-after: always;
  302. page-break-inside: avoid;
  303. }
  304. }
  305. </style>
  306. <style scoped>
  307. #mozPrintCallback-shim {
  308. position: fixed;
  309. top: 0;
  310. left: 0;
  311. height: 100%;
  312. width: 100%;
  313. z-index: 9999999;
  314. display: block;
  315. text-align: center;
  316. background-color: rgba(0, 0, 0, 0.5);
  317. }
  318. #mozPrintCallback-shim[hidden] {
  319. display: none;
  320. }
  321. @media print {
  322. #mozPrintCallback-shim {
  323. display: none;
  324. }
  325. }
  326. #mozPrintCallback-shim .mozPrintCallback-dialog-box {
  327. display: inline-block;
  328. margin: -50px auto 0;
  329. position: relative;
  330. top: 45%;
  331. left: 0;
  332. min-width: 220px;
  333. max-width: 400px;
  334. padding: 9px;
  335. border: 1px solid hsla(0, 0%, 0%, .5);
  336. border-radius: 2px;
  337. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  338. background-color: #474747;
  339. color: hsl(0, 0%, 85%);
  340. font-size: 16px;
  341. line-height: 20px;
  342. }
  343. #mozPrintCallback-shim .progress-row {
  344. clear: both;
  345. padding: 1em 0;
  346. }
  347. #mozPrintCallback-shim progress {
  348. width: 100%;
  349. }
  350. #mozPrintCallback-shim .relative-progress {
  351. clear: both;
  352. float: right;
  353. }
  354. #mozPrintCallback-shim .progress-actions {
  355. clear: both;
  356. }
  357. </style>
  358. <div class="mozPrintCallback-dialog-box">
  359. <!-- TODO: Localise the following strings -->
  360. Preparing document for printing...
  361. <div class="progress-row">
  362. <progress value="0" max="100"></progress>
  363. <span class="relative-progress">0%</span>
  364. </div>
  365. <div class="progress-actions">
  366. <input type="button" value="Cancel" class="mozPrintCallback-cancel">
  367. </div>
  368. </div>
  369. </div>
  370. </body>
  371. </html>