2013-11-23 04:10:43 +09:00
<!DOCTYPE html>
2012-09-01 07:48:21 +09:00
<!--
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.
2014-03-11 05:03:35 +09:00
2015-06-30 16:33:25 +09:00
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
2012-09-01 07:48:21 +09:00
-->
2013-02-17 19:01:19 +09:00
< html dir = "ltr" mozdisallowselectionprint moznomarginboxes >
2012-04-12 08:12:51 +09:00
< head >
2012-05-01 11:55:21 +09:00
< meta charset = "utf-8" >
2012-05-24 06:50:54 +09:00
< meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=1" >
2013-07-16 07:13:05 +09:00
<!-- #if GENERIC || CHROME -->
< meta name = "google" content = "notranslate" >
2015-07-21 20:40:07 +09:00
<!-- #endif -->
<!-- #if GENERIC -->
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
2013-07-16 07:13:05 +09:00
<!-- #endif -->
2012-04-19 04:02:49 +09:00
< title > PDF.js viewer< / title >
2012-08-02 03:29:13 +09:00
2012-08-02 04:16:28 +09:00
<!-- #if FIREFOX || MOZCENTRAL -->
2012-08-02 03:29:13 +09:00
<!-- #include viewer - snippet - firefox - extension.html -->
[CRX] Show nicely formatted URL in omnibox
Before commit:
chrome-extension://EXTENSIONID/content/web/viewer.html?file=http%3A%2F%2Fexample.com%2Ffile.pdf
After commit:
chrome-extension://EXTENSIONID/http://example/file.pdf
Technical details:
- The extension's background page uses the webRequest API to intercept
requests for <extension host>/<real path to pdf>, and redirect it to
the viewer's URL.
- viewer.js uses history.replaceState to rewrite the URL, so that it's
easier for users to recognize and copy-paste URLs.
- The fake paths /http:, /https:, /file:, etc. have been added to the
web_accessible_resources section of the manifest file, in order to
avoid seeing chrome-extension://invalid/ instead of the actual URL
when using history back/forward to navigate from/to the PDF viewer.
- Since the relative path resolving doesn't work because relative URLs
are inaccurate, a <base> tag has been added. This method has already
been proven to work in the Firefox add-on.
Notes:
- This commit has been cherry-picked from crx-using-streams-api.
- Need to merge https://github.com/mozilla/pdf.js/pull/3582 to deal with
a bug in Chrome <=30
- In Chrome, getting the contents of a FTP file is not possible, so
there's no support for FTP files, even though the extension router
recognizes the ftp: scheme.
2013-08-16 05:47:30 +09:00
<!-- #endif -->
<!-- #if CHROME -->
<!-- #include viewer - snippet - chrome - extension.html -->
2012-08-02 03:29:13 +09:00
<!-- #endif -->
2012-04-12 08:12:51 +09:00
< link rel = "stylesheet" href = "viewer.css" / >
2012-08-02 03:29:13 +09:00
<!-- #if !PRODUCTION -->
2012-11-30 05:02:33 +09:00
< link rel = "resource" type = "application/l10n" href = "locale/locale.properties" / >
2012-08-02 03:29:13 +09:00
<!-- #endif -->
2014-05-30 01:50:16 +09:00
<!-- #if !(MOZCENTRAL || CHROME || MINIFIED) -->
2014-05-13 09:41:01 +09:00
< script src = "compatibility.js" > < / script >
2012-08-02 03:29:13 +09:00
<!-- #endif -->
<!-- #if !PRODUCTION -->
2014-05-13 09:41:01 +09:00
< script src = "../external/webL10n/l10n.js" > < / script >
2012-08-02 03:29:13 +09:00
<!-- #endif -->
<!-- #if !PRODUCTION -->
2014-05-13 09:41:01 +09:00
< script src = "../src/shared/util.js" > < / script >
< script src = "../src/display/api.js" > < / script >
< script src = "../src/display/metadata.js" > < / script >
< script src = "../src/display/canvas.js" > < / script >
< script src = "../src/display/webgl.js" > < / script >
< script src = "../src/display/pattern_helper.js" > < / script >
< script src = "../src/display/font_loader.js" > < / script >
2014-06-18 07:43:33 +09:00
< script src = "../src/display/annotation_helper.js" > < / script >
2014-05-13 09:41:01 +09:00
< script > PDFJS . workerSrc = '../src/worker_loader.js' ; < / script >
2012-08-02 03:29:13 +09:00
<!-- #endif -->
2014-01-18 01:50:54 +09:00
<!-- #if (GENERIC && !MINIFIED) -->
2012-08-02 03:29:13 +09:00
<!-- #include viewer - snippet.html -->
<!-- #endif -->
2013-06-19 01:05:55 +09:00
<!-- #if !PRODUCTION -->
2014-05-13 09:41:01 +09:00
< script src = "ui_utils.js" > < / script >
< script src = "default_preferences.js" > < / script >
< script src = "preferences.js" > < / script >
< script src = "download_manager.js" > < / script >
< script src = "view_history.js" > < / script >
2015-04-28 00:25:32 +09:00
< script src = "pdf_link_service.js" > < / script >
2014-09-16 01:18:28 +09:00
< script src = "pdf_rendering_queue.js" > < / script >
2014-09-28 01:58:42 +09:00
< script src = "pdf_page_view.js" > < / script >
2014-09-16 05:46:01 +09:00
< script src = "text_layer_builder.js" > < / script >
2014-09-30 01:05:28 +09:00
< script src = "annotations_layer_builder.js" > < / script >
2014-09-13 11:27:45 +09:00
< script src = "pdf_viewer.js" > < / script >
2015-01-24 23:46:10 +09:00
< script src = "pdf_thumbnail_view.js" > < / script >
2015-01-24 21:51:55 +09:00
< script src = "pdf_thumbnail_viewer.js" > < / script >
2015-01-28 06:38:45 +09:00
< script src = "pdf_outline_view.js" > < / script >
2015-01-28 05:49:29 +09:00
< script src = "pdf_attachment_view.js" > < / script >
2014-05-13 09:41:01 +09:00
< script src = "pdf_find_bar.js" > < / script >
< script src = "pdf_find_controller.js" > < / script >
< script src = "pdf_history.js" > < / script >
< script src = "secondary_toolbar.js" > < / script >
2015-01-28 21:58:40 +09:00
< script src = "pdf_presentation_mode.js" > < / script >
2014-05-13 09:41:01 +09:00
< script src = "grab_to_pan.js" > < / script >
< script src = "hand_tool.js" > < / script >
2014-05-13 19:08:39 +09:00
< script src = "overlay_manager.js" > < / script >
< script src = "password_prompt.js" > < / script >
2015-04-25 03:35:11 +09:00
< script src = "pdf_document_properties.js" > < / script >
2013-06-19 01:05:55 +09:00
<!-- #endif -->
2014-01-18 01:50:54 +09:00
<!-- #if !MINIFIED -->
2014-05-13 09:41:01 +09:00
< script src = "debugger.js" > < / script >
< script src = "viewer.js" > < / script >
2014-01-18 01:50:54 +09:00
<!-- #else -->
<!-- #include viewer - snippet - minified.html -->
<!-- #endif -->
2013-06-19 01:05:55 +09:00
2012-04-12 08:12:51 +09:00
< / head >
2011-05-26 23:02:52 +09:00
2014-08-17 07:22:05 +09:00
< body tabindex = "1" class = "loadingInProgress" >
< div id = "outerContainer" >
2011-07-29 02:48:05 +09:00
2012-04-26 05:46:17 +09:00
< div id = "sidebarContainer" >
2012-10-30 06:35:07 +09:00
< div id = "toolbarSidebar" >
< div class = "splitToolbarButton toggled" >
2013-02-25 01:49:42 +09:00
< button id = "viewThumbnail" class = "toolbarButton group toggled" title = "Show Thumbnails" tabindex = "2" data-l10n-id = "thumbs" >
2012-10-30 06:35:07 +09:00
< span data-l10n-id = "thumbs_label" > Thumbnails< / span >
< / button >
2013-02-25 01:49:42 +09:00
< button id = "viewOutline" class = "toolbarButton group" title = "Show Document Outline" tabindex = "3" data-l10n-id = "outline" >
2012-10-30 06:35:07 +09:00
< span data-l10n-id = "outline_label" > Document Outline< / span >
< / button >
2014-03-19 05:32:47 +09:00
< button id = "viewAttachments" class = "toolbarButton group" title = "Show Attachments" tabindex = "4" data-l10n-id = "attachments" >
< span data-l10n-id = "attachments_label" > Attachments< / span >
< / button >
2012-10-30 06:35:07 +09:00
< / div >
2011-07-29 02:48:05 +09:00
< / div >
2012-04-26 03:34:28 +09:00
< div id = "sidebarContent" >
< div id = "thumbnailView" >
2012-04-12 08:12:51 +09:00
< / div >
2012-04-26 03:34:28 +09:00
< div id = "outlineView" class = "hidden" >
2012-04-12 08:12:51 +09:00
< / div >
2014-03-19 05:32:47 +09:00
< div id = "attachmentsView" class = "hidden" >
< / div >
2011-08-22 11:05:10 +09:00
< / div >
2012-04-26 03:34:28 +09:00
< / div > <!-- sidebarContainer -->
< div id = "mainContainer" >
2013-02-26 09:53:54 +09:00
< div class = "findbar hidden doorHanger hiddenSmallView" id = "findbar" >
2012-10-06 09:15:06 +09:00
< label for = "findInput" class = "toolbarLabel" data-l10n-id = "find_label" > Find:< / label >
2014-07-19 19:16:44 +09:00
< input id = "findInput" class = "toolbarField" tabindex = "91" >
2012-10-06 09:15:06 +09:00
< div class = "splitToolbarButton" >
2014-07-19 19:16:44 +09:00
< button class = "toolbarButton findPrevious" title = "" id = "findPrevious" tabindex = "92" data-l10n-id = "find_previous" >
2012-10-06 09:15:06 +09:00
< span data-l10n-id = "find_previous_label" > Previous< / span >
< / button >
< div class = "splitToolbarButtonSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button class = "toolbarButton findNext" title = "" id = "findNext" tabindex = "93" data-l10n-id = "find_next" >
2012-10-06 09:15:06 +09:00
< span data-l10n-id = "find_next_label" > Next< / span >
< / button >
< / div >
2015-07-17 03:23:14 +09:00
< 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 >
2012-10-06 09:15:06 +09:00
< span id = "findMsg" class = "toolbarLabel" > < / span >
2013-09-05 06:48:31 +09:00
< / div > <!-- findbar -->
< div id = "secondaryToolbar" class = "secondaryToolbar hidden doorHangerRight" >
< div id = "secondaryToolbarButtonContainer" >
2014-07-19 19:16:44 +09:00
< button id = "secondaryPresentationMode" class = "secondaryToolbarButton presentationMode visibleLargeView" title = "Switch to Presentation Mode" tabindex = "51" data-l10n-id = "presentation_mode" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "presentation_mode_label" > Presentation Mode< / span >
< / button >
2014-07-19 19:16:44 +09:00
< button id = "secondaryOpenFile" class = "secondaryToolbarButton openFile visibleLargeView" title = "Open File" tabindex = "52" data-l10n-id = "open_file" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "open_file_label" > Open< / span >
< / button >
2014-07-19 19:16:44 +09:00
< button id = "secondaryPrint" class = "secondaryToolbarButton print visibleMediumView" title = "Print" tabindex = "53" data-l10n-id = "print" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "print_label" > Print< / span >
< / button >
2014-07-19 19:16:44 +09:00
< button id = "secondaryDownload" class = "secondaryToolbarButton download visibleMediumView" title = "Download" tabindex = "54" data-l10n-id = "download" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "download_label" > Download< / span >
< / button >
2014-07-19 19:16:44 +09:00
< a href = "#" id = "secondaryViewBookmark" class = "secondaryToolbarButton bookmark visibleSmallView" title = "Current view (copy or open in new window)" tabindex = "55" data-l10n-id = "bookmark" >
2013-09-27 18:44:45 +09:00
< span data-l10n-id = "bookmark_label" > Current View< / span >
< / a >
2013-09-05 06:48:31 +09:00
< div class = "horizontalToolbarSeparator visibleLargeView" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "firstPage" class = "secondaryToolbarButton firstPage" title = "Go to First Page" tabindex = "56" data-l10n-id = "first_page" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "first_page_label" > Go to First Page< / span >
< / button >
2014-07-19 19:16:44 +09:00
< button id = "lastPage" class = "secondaryToolbarButton lastPage" title = "Go to Last Page" tabindex = "57" data-l10n-id = "last_page" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "last_page_label" > Go to Last Page< / span >
< / button >
< div class = "horizontalToolbarSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "pageRotateCw" class = "secondaryToolbarButton rotateCw" title = "Rotate Clockwise" tabindex = "58" data-l10n-id = "page_rotate_cw" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "page_rotate_cw_label" > Rotate Clockwise< / span >
< / button >
2014-07-19 19:16:44 +09:00
< button id = "pageRotateCcw" class = "secondaryToolbarButton rotateCcw" title = "Rotate Counterclockwise" tabindex = "59" data-l10n-id = "page_rotate_ccw" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "page_rotate_ccw_label" > Rotate Counterclockwise< / span >
< / button >
2013-10-03 05:09:43 +09:00
< div class = "horizontalToolbarSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "toggleHandTool" class = "secondaryToolbarButton handTool" title = "Enable hand tool" tabindex = "60" data-l10n-id = "hand_tool_enable" >
2013-10-03 05:09:43 +09:00
< span data-l10n-id = "hand_tool_enable_label" > Enable hand tool< / span >
< / button >
2015-02-03 00:12:52 +09:00
2014-01-22 08:07:07 +09:00
< div class = "horizontalToolbarSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "documentProperties" class = "secondaryToolbarButton documentProperties" title = "Document Properties…" tabindex = "61" data-l10n-id = "document_properties" >
2014-01-23 08:30:48 +09:00
< span data-l10n-id = "document_properties_label" > Document Properties…< / span >
2014-01-22 08:07:07 +09:00
< / button >
2013-09-05 06:48:31 +09:00
< / div >
< / div > <!-- secondaryToolbar -->
2012-04-26 03:34:28 +09:00
< div class = "toolbar" >
< div id = "toolbarContainer" >
< div id = "toolbarViewer" >
< div id = "toolbarViewerLeft" >
2014-07-19 19:16:44 +09:00
< button id = "sidebarToggle" class = "toolbarButton" title = "Toggle Sidebar" tabindex = "11" data-l10n-id = "toggle_sidebar" >
2013-01-31 22:14:48 +09:00
< span data-l10n-id = "toggle_sidebar_label" > Toggle Sidebar< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< div class = "toolbarButtonSpacer" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "viewFind" class = "toolbarButton group hiddenSmallView" title = "Find in Document" tabindex = "12" data-l10n-id = "findbar" >
2012-10-06 09:15:06 +09:00
< span data-l10n-id = "findbar_label" > Find< / span >
2012-09-29 04:30:07 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< div class = "splitToolbarButton" >
2014-07-19 19:16:44 +09:00
< button class = "toolbarButton pageUp" title = "Previous Page" id = "previous" tabindex = "13" data-l10n-id = "previous" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "previous_label" > Previous< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< div class = "splitToolbarButtonSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button class = "toolbarButton pageDown" title = "Next Page" id = "next" tabindex = "14" data-l10n-id = "next" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "next_label" > Next< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< / div >
2012-05-16 04:47:33 +09:00
< label id = "pageNumberLabel" class = "toolbarLabel" for = "pageNumber" data-l10n-id = "page_label" > Page: < / label >
2014-07-19 19:16:44 +09:00
< input type = "number" id = "pageNumber" class = "toolbarField pageNumber" value = "1" size = "4" min = "1" tabindex = "15" >
2012-04-26 03:34:28 +09:00
< span id = "numPages" class = "toolbarLabel" > < / span >
< / div >
< div id = "toolbarViewerRight" >
2014-07-19 19:16:44 +09:00
< button id = "presentationMode" class = "toolbarButton presentationMode hiddenLargeView" title = "Switch to Presentation Mode" tabindex = "31" data-l10n-id = "presentation_mode" >
2012-09-21 23:35:18 +09:00
< span data-l10n-id = "presentation_mode_label" > Presentation Mode< / span >
2012-07-31 00:58:34 +09:00
< / button >
2012-07-31 00:12:49 +09:00
2014-07-19 19:16:44 +09:00
< button id = "openFile" class = "toolbarButton openFile hiddenLargeView" title = "Open File" tabindex = "32" data-l10n-id = "open_file" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "open_file_label" > Open< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-05-02 01:43:48 +09:00
2014-07-19 19:16:44 +09:00
< button id = "print" class = "toolbarButton print hiddenMediumView" title = "Print" tabindex = "33" data-l10n-id = "print" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "print_label" > Print< / span >
2012-05-04 23:51:21 +09:00
< / button >
2014-07-19 19:16:44 +09:00
< button id = "download" class = "toolbarButton download hiddenMediumView" title = "Download" tabindex = "34" data-l10n-id = "download" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "download_label" > Download< / span >
2012-05-04 23:51:21 +09:00
< / button >
2014-07-19 19:16:44 +09:00
< a href = "#" id = "viewBookmark" class = "toolbarButton bookmark hiddenSmallView" title = "Current view (copy or open in new window)" tabindex = "35" data-l10n-id = "bookmark" >
2013-09-27 18:44:45 +09:00
< span data-l10n-id = "bookmark_label" > Current View< / span >
< / a >
2013-09-05 06:48:31 +09:00
< div class = "verticalToolbarSeparator hiddenSmallView" > < / div >
2015-02-03 00:12:52 +09:00
2014-07-19 19:16:44 +09:00
< button id = "secondaryToolbarToggle" class = "toolbarButton" title = "Tools" tabindex = "36" data-l10n-id = "tools" >
2013-09-05 06:48:31 +09:00
< span data-l10n-id = "tools_label" > Tools< / span >
2015-02-03 00:12:52 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< / div >
< div class = "outerCenter" >
< div class = "innerCenter" id = "toolbarViewerMiddle" >
< div class = "splitToolbarButton" >
2014-07-19 19:16:44 +09:00
< button id = "zoomOut" class = "toolbarButton zoomOut" title = "Zoom Out" tabindex = "21" data-l10n-id = "zoom_out" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "zoom_out_label" > Zoom Out< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< div class = "splitToolbarButtonSeparator" > < / div >
2014-07-19 19:16:44 +09:00
< button id = "zoomIn" class = "toolbarButton zoomIn" title = "Zoom In" tabindex = "22" data-l10n-id = "zoom_in" >
2012-05-05 03:13:29 +09:00
< span data-l10n-id = "zoom_in_label" > Zoom In< / span >
2012-05-04 23:51:21 +09:00
< / button >
2012-04-26 03:34:28 +09:00
< / div >
2012-05-16 04:47:33 +09:00
< span id = "scaleSelectContainer" class = "dropdownToolbarButton" >
2014-07-19 19:16:44 +09:00
< select id = "scaleSelect" title = "Zoom" tabindex = "23" data-l10n-id = "zoom" >
2014-04-15 06:35:29 +09:00
< 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 >
2014-10-16 21:36:03 +09:00
< 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 >
2012-04-26 03:34:28 +09:00
< / select >
< / span >
< / div >
< / div >
< / div >
2013-02-07 08:19:29 +09:00
< div id = "loadingBar" >
< div class = "progress" >
< div class = "glimmer" >
< / div >
< / div >
< / div >
2011-12-12 10:38:20 +09:00
< / div >
< / div >
2011-05-26 23:02:52 +09:00
2012-09-08 08:05:14 +09:00
< menu type = "context" id = "viewerContextMenu" >
2013-09-05 06:48:31 +09:00
< 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 >
2012-09-08 08:05:14 +09:00
< / menu >
2013-07-06 22:37:03 +09:00
< div id = "viewerContainer" tabindex = "0" >
2014-10-01 00:48:29 +09:00
< div id = "viewer" class = "pdfViewer" > < / div >
2011-07-29 02:48:05 +09:00
< / div >
2012-04-12 08:12:51 +09:00
2012-04-26 09:20:13 +09:00
< div id = "errorWrapper" hidden = 'true' >
< div id = "errorMessageLeft" >
< span id = "errorMessage" > < / span >
2013-07-18 07:40:15 +09:00
< button id = "errorShowMore" data-l10n-id = "error_more_info" >
2012-04-26 09:20:13 +09:00
More Information
< / button >
2013-07-18 07:40:15 +09:00
< button id = "errorShowLess" data-l10n-id = "error_less_info" hidden = 'true' >
2012-04-26 09:20:13 +09:00
Less Information
< / button >
< / div >
< div id = "errorMessageRight" >
2013-07-18 07:40:15 +09:00
< button id = "errorClose" data-l10n-id = "error_close" >
2012-04-26 09:20:13 +09:00
Close
< / button >
< / div >
< div class = "clearBoth" > < / div >
< textarea id = "errorMoreInfo" hidden = 'true' readonly = "readonly" > < / textarea >
2011-08-22 11:05:10 +09:00
< / div >
2012-04-26 03:34:28 +09:00
< / div > <!-- mainContainer -->
2011-10-28 21:32:36 +09:00
2013-09-25 00:46:54 +09:00
< div id = "overlayContainer" class = "hidden" >
2014-05-12 22:50:13 +09:00
< div id = "passwordOverlay" class = "container hidden" >
< div class = "dialog" >
2013-09-25 00:46:54 +09:00
< div class = "row" >
< p id = "passwordText" data-l10n-id = "password_label" > Enter the password to open this PDF file:< / p >
< / div >
< div class = "row" >
< input type = "password" id = "password" class = "toolbarField" / >
< / div >
2014-01-22 08:07:07 +09:00
< 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 >
2014-05-12 22:50:13 +09:00
< div id = "documentPropertiesOverlay" class = "container hidden" >
< div class = "dialog" >
2014-01-22 08:07:07 +09:00
< div class = "row" >
< span data-l10n-id = "document_properties_file_name" > File name:< / span > < p id = "fileNameField" > -< / p >
< / div >
2013-09-25 00:46:54 +09:00
< div class = "row" >
2014-01-22 08:07:07 +09:00
< 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" >
2014-05-12 22:50:13 +09:00
< button id = "documentPropertiesClose" class = "overlayButton" > < span data-l10n-id = "document_properties_close" > Close< / span > < / button >
2013-09-25 00:46:54 +09:00
< / div >
< / div >
< / div >
2015-07-19 00:11:33 +09:00
<!-- #if CHROME -->
<!-- #include viewer - snippet - chrome - overlays.html -->
<!-- #endif -->
2014-01-22 08:07:07 +09:00
< / div > <!-- overlayContainer -->
2013-09-25 00:46:54 +09:00
2012-04-13 08:29:15 +09:00
< / div > <!-- outerContainer -->
2012-06-29 01:50:25 +09:00
< div id = "printContainer" > < / div >
Add mozPrintCallback shim
This shim does the following:
1. Intercept window.print()
2. For a window.print() call (if allowed, ie. no previous print job):
1. Dispatch the beforeprint event.
2. Render a printg progress dialog.
3. For each canvas, call mozPrintCallback if existent (one at a time, async).
4. During each mozPrintCallback callback, update the progress dialog.
5. When all <canvas>es have been rendered, invoke the real window.print().
6. Dispatch the afterprint event.
The shim is not included in Firefox through the preprocessor.
Keyboard shortcuts (Ctrl/Cmd + P) are intercepted and default behavior
(i.e. printing) is prevented, and the steps for window.print() are run.
window.attachEvent is used, in order to cancel printing in IE10 and
earlier (courtesy of Stack Overflow - http://stackoverflow.com/a/15302847).
Unfortunately, this doesn't work in IE11 - if Ctrl + P is used, the
print dialog will be shown twice: Once because of Ctrl + P, and again
when all pages have finished rendering.
This logic of this polyfill is not specific to PDF.js, so it can also
be used in other projects.
There's one additional modification in PDF.js's viewer.js: The printed
<canvas> element is wrapped in a <div>. This is needed, because Chrome
would otherwise print one canvas on two pages.
2013-09-11 01:17:26 +09:00
<!-- #if !(FIREFOX || MOZCENTRAL) -->
<!-- #include viewer - snippet - mozPrintCallback - polyfill.html -->
2015-04-13 19:29:16 +09:00
<!-- #endif -->
2011-05-26 23:02:52 +09:00
< / body >
2011-05-05 09:32:59 +09:00
< / html >