viewer.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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. <!-- This snippet is used in production (included from viewer.html) -->
  26. <link rel="resource" type="application/l10n" href="locale/locale.properties">
  27. <script src="../build/pdf.js"></script>
  28. <script src="viewer.js"></script>
  29. </head>
  30. <body tabindex="1" class="loadingInProgress">
  31. <div id="outerContainer">
  32. <div id="sidebarContainer">
  33. <div id="toolbarSidebar">
  34. <div class="splitToolbarButton toggled">
  35. <button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
  36. <span data-l10n-id="thumbs_label">Thumbnails</span>
  37. </button>
  38. <button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)"
  39. tabindex="3" data-l10n-id="document_outline">
  40. <span data-l10n-id="document_outline_label">Document Outline</span>
  41. </button>
  42. <button id="viewAttachments" class="toolbarButton" 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>
  56. <!-- sidebarContainer -->
  57. <div id="mainContainer">
  58. <div class="findbar hidden doorHanger" id="findbar">
  59. <div id="findbarInputContainer">
  60. <input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
  61. <div class="splitToolbarButton">
  62. <button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92"
  63. data-l10n-id="find_previous">
  64. <span data-l10n-id="find_previous_label">Previous</span>
  65. </button>
  66. <div class="splitToolbarButtonSeparator"></div>
  67. <button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
  68. <span data-l10n-id="find_next_label">Next</span>
  69. </button>
  70. </div>
  71. </div>
  72. <div id="findbarOptionsContainer">
  73. <input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
  74. <label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
  75. <input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
  76. <label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
  77. <span id="findResultsCount" class="toolbarLabel hidden"></span>
  78. </div>
  79. <div id="findbarMessageContainer">
  80. <span id="findMsg" class="toolbarLabel"></span>
  81. </div>
  82. </div>
  83. <!-- findbar -->
  84. <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
  85. <div id="secondaryToolbarButtonContainer">
  86. <button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode"
  87. tabindex="51" data-l10n-id="presentation_mode">
  88. <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
  89. </button>
  90. <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
  91. <span data-l10n-id="open_file_label">Open</span>
  92. </button>
  93. <button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
  94. <span data-l10n-id="print_label">Print</span>
  95. </button>
  96. <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
  97. <span data-l10n-id="download_label">Download</span>
  98. </button>
  99. <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)"
  100. tabindex="55" data-l10n-id="bookmark">
  101. <span data-l10n-id="bookmark_label">Current View</span>
  102. </a>
  103. <div class="horizontalToolbarSeparator visibleLargeView"></div>
  104. <button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
  105. <span data-l10n-id="first_page_label">Go to First Page</span>
  106. </button>
  107. <button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="57" data-l10n-id="last_page">
  108. <span data-l10n-id="last_page_label">Go to Last Page</span>
  109. </button>
  110. <div class="horizontalToolbarSeparator"></div>
  111. <button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw">
  112. <span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
  113. </button>
  114. <button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw">
  115. <span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
  116. </button>
  117. <div class="horizontalToolbarSeparator"></div>
  118. <button id="cursorSelectTool" class="secondaryToolbarButton selectTool toggled" title="Enable Text Selection Tool" tabindex="60"
  119. data-l10n-id="cursor_text_select_tool">
  120. <span data-l10n-id="cursor_text_select_tool_label">Text Selection Tool</span>
  121. </button>
  122. <button id="cursorHandTool" class="secondaryToolbarButton handTool" title="Enable Hand Tool" tabindex="61" data-l10n-id="cursor_hand_tool">
  123. <span data-l10n-id="cursor_hand_tool_label">Hand Tool</span>
  124. </button>
  125. <div class="horizontalToolbarSeparator"></div>
  126. <button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="62"
  127. data-l10n-id="document_properties">
  128. <span data-l10n-id="document_properties_label">Document Properties…</span>
  129. </button>
  130. </div>
  131. </div>
  132. <!-- secondaryToolbar -->
  133. <div class="toolbar">
  134. <div id="toolbarContainer">
  135. <div id="toolbarViewer">
  136. <div id="toolbarViewerLeft">
  137. <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar">
  138. <span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
  139. </button>
  140. <div class="toolbarButtonSpacer"></div>
  141. <button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar">
  142. <span data-l10n-id="findbar_label">Find</span>
  143. </button>
  144. <div class="splitToolbarButton hiddenSmallView">
  145. <button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
  146. <span data-l10n-id="previous_label">Previous</span>
  147. </button>
  148. <div class="splitToolbarButtonSeparator"></div>
  149. <button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next">
  150. <span data-l10n-id="next_label">Next</span>
  151. </button>
  152. </div>
  153. <input type="number" id="pageNumber" class="toolbarField pageNumber" title="Page" value="1" size="4" min="1" tabindex="15"
  154. data-l10n-id="page">
  155. <span id="numPages" class="toolbarLabel"></span>
  156. </div>
  157. <div id="toolbarViewerRight">
  158. <button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode"
  159. tabindex="31" data-l10n-id="presentation_mode">
  160. <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
  161. </button>
  162. <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
  163. <span data-l10n-id="open_file_label">Open</span>
  164. </button>
  165. <button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
  166. <span data-l10n-id="print_label">Print</span>
  167. </button>
  168. <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
  169. <span data-l10n-id="download_label">Download</span>
  170. </button>
  171. <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)"
  172. tabindex="35" data-l10n-id="bookmark">
  173. <span data-l10n-id="bookmark_label">Current View</span>
  174. </a>
  175. <div class="verticalToolbarSeparator hiddenSmallView"></div>
  176. <button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="36" data-l10n-id="tools">
  177. <span data-l10n-id="tools_label">Tools</span>
  178. </button>
  179. </div>
  180. <div id="toolbarViewerMiddle">
  181. <div class="splitToolbarButton">
  182. <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">
  183. <span data-l10n-id="zoom_out_label">Zoom Out</span>
  184. </button>
  185. <div class="splitToolbarButtonSeparator"></div>
  186. <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in">
  187. <span data-l10n-id="zoom_in_label">Zoom In</span>
  188. </button>
  189. </div>
  190. <span id="scaleSelectContainer" class="dropdownToolbarButton">
  191. <select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
  192. <option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
  193. <option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
  194. <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Page Fit</option>
  195. <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Page Width</option>
  196. <option id="customScaleOption" title="" value="custom" disabled="disabled" hidden="true"></option>
  197. <option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
  198. <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
  199. <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
  200. <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
  201. <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
  202. <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>
  203. <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option>
  204. <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option>
  205. </select>
  206. </span>
  207. </div>
  208. </div>
  209. <div id="loadingBar">
  210. <div class="progress">
  211. <div class="glimmer">
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <menu type="context" id="viewerContextMenu">
  218. <menuitem id="contextFirstPage" label="First Page" data-l10n-id="first_page"></menuitem>
  219. <menuitem id="contextLastPage" label="Last Page" data-l10n-id="last_page"></menuitem>
  220. <menuitem id="contextPageRotateCw" label="Rotate Clockwise" data-l10n-id="page_rotate_cw"></menuitem>
  221. <menuitem id="contextPageRotateCcw" label="Rotate Counter-Clockwise" data-l10n-id="page_rotate_ccw"></menuitem>
  222. </menu>
  223. <div id="viewerContainer" tabindex="0">
  224. <div id="viewer" class="pdfViewer"></div>
  225. </div>
  226. <div id="errorWrapper" hidden='true'>
  227. <div id="errorMessageLeft">
  228. <span id="errorMessage"></span>
  229. <button id="errorShowMore" data-l10n-id="error_more_info">
  230. More Information
  231. </button>
  232. <button id="errorShowLess" data-l10n-id="error_less_info" hidden='true'>
  233. Less Information
  234. </button>
  235. </div>
  236. <div id="errorMessageRight">
  237. <button id="errorClose" data-l10n-id="error_close">
  238. Close
  239. </button>
  240. </div>
  241. <div class="clearBoth"></div>
  242. <textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea>
  243. </div>
  244. </div>
  245. <!-- mainContainer -->
  246. <div id="overlayContainer" class="hidden">
  247. <div id="passwordOverlay" class="container hidden">
  248. <div class="dialog">
  249. <div class="row">
  250. <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
  251. </div>
  252. <div class="row">
  253. <input type="password" id="password" class="toolbarField">
  254. </div>
  255. <div class="buttonRow">
  256. <button id="passwordCancel" class="overlayButton">
  257. <span data-l10n-id="password_cancel">Cancel</span>
  258. </button>
  259. <button id="passwordSubmit" class="overlayButton">
  260. <span data-l10n-id="password_ok">OK</span>
  261. </button>
  262. </div>
  263. </div>
  264. </div>
  265. <div id="documentPropertiesOverlay" class="container hidden">
  266. <div class="dialog">
  267. <div class="row">
  268. <span data-l10n-id="document_properties_file_name">File name:</span>
  269. <p id="fileNameField">-</p>
  270. </div>
  271. <div class="row">
  272. <span data-l10n-id="document_properties_file_size">File size:</span>
  273. <p id="fileSizeField">-</p>
  274. </div>
  275. <div class="separator"></div>
  276. <div class="row">
  277. <span data-l10n-id="document_properties_title">Title:</span>
  278. <p id="titleField">-</p>
  279. </div>
  280. <div class="row">
  281. <span data-l10n-id="document_properties_author">Author:</span>
  282. <p id="authorField">-</p>
  283. </div>
  284. <div class="row">
  285. <span data-l10n-id="document_properties_subject">Subject:</span>
  286. <p id="subjectField">-</p>
  287. </div>
  288. <div class="row">
  289. <span data-l10n-id="document_properties_keywords">Keywords:</span>
  290. <p id="keywordsField">-</p>
  291. </div>
  292. <div class="row">
  293. <span data-l10n-id="document_properties_creation_date">Creation Date:</span>
  294. <p id="creationDateField">-</p>
  295. </div>
  296. <div class="row">
  297. <span data-l10n-id="document_properties_modification_date">Modification Date:</span>
  298. <p id="modificationDateField">-</p>
  299. </div>
  300. <div class="row">
  301. <span data-l10n-id="document_properties_creator">Creator:</span>
  302. <p id="creatorField">-</p>
  303. </div>
  304. <div class="separator"></div>
  305. <div class="row">
  306. <span data-l10n-id="document_properties_producer">PDF Producer:</span>
  307. <p id="producerField">-</p>
  308. </div>
  309. <div class="row">
  310. <span data-l10n-id="document_properties_version">PDF Version:</span>
  311. <p id="versionField">-</p>
  312. </div>
  313. <div class="row">
  314. <span data-l10n-id="document_properties_page_count">Page Count:</span>
  315. <p id="pageCountField">-</p>
  316. </div>
  317. <div class="buttonRow">
  318. <button id="documentPropertiesClose" class="overlayButton">
  319. <span data-l10n-id="document_properties_close">Close</span>
  320. </button>
  321. </div>
  322. </div>
  323. </div>
  324. <div id="printServiceOverlay" class="container hidden">
  325. <div class="dialog">
  326. <div class="row">
  327. <span data-l10n-id="print_progress_message">Preparing document for printing…</span>
  328. </div>
  329. <div class="row">
  330. <progress value="0" max="100"></progress>
  331. <span data-l10n-id="print_progress_percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
  332. </div>
  333. <div class="buttonRow">
  334. <button id="printCancel" class="overlayButton">
  335. <span data-l10n-id="print_progress_close">Cancel</span>
  336. </button>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <!-- overlayContainer -->
  342. </div>
  343. <!-- outerContainer -->
  344. <div id="printContainer"></div>
  345. </body>
  346. </html>