2022-12-15 00:40:25 +09:00
|
|
|
|
<!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>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
|
|
<title>PDF.js viewer</title>
|
|
|
|
|
|
|
|
|
|
<!--#if MOZCENTRAL-->
|
|
|
|
|
<!--#include viewer-snippet-firefox-extension.html-->
|
|
|
|
|
<!--#endif-->
|
|
|
|
|
|
|
|
|
|
<!--#if MOZCENTRAL-->
|
2023-03-14 00:56:42 +09:00
|
|
|
|
<!--<link rel="stylesheet" href="resource://pdf.js/web/viewer.css">-->
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<!--<link rel="localization" href="toolkit/pdfviewer/viewer.ftl"/>-->
|
2022-12-15 00:40:25 +09:00
|
|
|
|
<!--#else-->
|
|
|
|
|
<link rel="stylesheet" href="viewer-geckoview.css">
|
|
|
|
|
<!--#endif-->
|
|
|
|
|
|
|
|
|
|
<!--#if !MOZCENTRAL-->
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<link rel="resource" type="application/l10n" href="locale/locale.json">
|
2022-12-15 00:40:25 +09:00
|
|
|
|
<!--#endif-->
|
|
|
|
|
|
|
|
|
|
<!--#if !MOZCENTRAL-->
|
2022-04-02 20:00:25 +09:00
|
|
|
|
<script type="importmap">
|
2022-12-15 00:40:25 +09:00
|
|
|
|
{
|
|
|
|
|
"imports": {
|
|
|
|
|
"pdfjs/": "../src/",
|
|
|
|
|
"pdfjs-lib": "../src/pdf.js",
|
|
|
|
|
"pdfjs-web/": "./",
|
2023-02-04 21:55:12 +09:00
|
|
|
|
|
2023-10-13 23:23:17 +09:00
|
|
|
|
"fluent-bundle": "../node_modules/@fluent/bundle/esm/index.js",
|
|
|
|
|
"fluent-dom": "../node_modules/@fluent/dom/esm/index.js",
|
|
|
|
|
"cached-iterable": "../node_modules/cached-iterable/src/index.mjs",
|
|
|
|
|
|
2023-07-13 18:58:16 +09:00
|
|
|
|
"display-fetch_stream": "../src/display/fetch_stream.js",
|
|
|
|
|
"display-network": "../src/display/network.js",
|
|
|
|
|
"display-node_stream": "../src/display/stubs.js",
|
|
|
|
|
"display-node_utils": "../src/display/stubs.js",
|
|
|
|
|
|
2023-09-21 19:51:34 +09:00
|
|
|
|
"web-alt_text_manager": "./stubs-geckoview.js",
|
2023-02-04 21:55:12 +09:00
|
|
|
|
"web-annotation_editor_params": "./stubs-geckoview.js",
|
2023-02-06 00:13:18 +09:00
|
|
|
|
"web-com": "./genericcom.js",
|
2024-01-26 19:50:25 +09:00
|
|
|
|
"web-download_manager": "./download_manager.js",
|
2024-01-26 22:31:42 +09:00
|
|
|
|
"web-external_services": "./genericcom.js",
|
2023-10-19 03:13:10 +09:00
|
|
|
|
"web-l10n_utils": "./l10n_utils.js",
|
2023-02-04 21:55:12 +09:00
|
|
|
|
"web-pdf_attachment_viewer": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_cursor_tools": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_document_properties": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_find_bar": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_layer_viewer": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_outline_viewer": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_presentation_mode": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_sidebar": "./stubs-geckoview.js",
|
|
|
|
|
"web-pdf_thumbnail_viewer": "./stubs-geckoview.js",
|
2024-01-26 20:04:54 +09:00
|
|
|
|
"web-preferences": "./genericcom.js",
|
2023-03-16 22:22:14 +09:00
|
|
|
|
"web-print_service": "./pdf_print_service.js",
|
2023-02-04 21:55:12 +09:00
|
|
|
|
"web-secondary_toolbar": "./stubs-geckoview.js",
|
2023-04-07 17:28:53 +09:00
|
|
|
|
"web-toolbar": "./toolbar-geckoview.js"
|
2022-12-15 00:40:25 +09:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2022-04-02 20:00:25 +09:00
|
|
|
|
<script src="viewer-geckoview.js" type="module"></script>
|
2022-12-15 00:40:25 +09:00
|
|
|
|
<!--#else-->
|
[api-major] Output JavaScript modules in the builds (issue 10317)
At this point in time all browsers, and also Node.js, support standard `import`/`export` statements and we can now finally consider outputting modern JavaScript modules in the builds.[1]
In order for this to work we can *only* use proper `import`/`export` statements throughout the main code-base, and (as expected) our Node.js support made this much more complicated since both the official builds and the GitHub Actions-based tests must keep working.[2]
One remaining issue is that the `pdf.scripting.js` file cannot be built as a JavaScript module, since doing so breaks PDF scripting.
Note that my initial goal was to try and split these changes into a couple of commits, however that unfortunately didn't really work since it turned out to be difficult for smaller patches to work correctly and pass (all) tests that way.[3]
This is a classic case of every change requiring a couple of other changes, with each of those changes requiring further changes in turn and the size/scope quickly increasing as a result.
One possible "issue" with these changes is that we'll now only output JavaScript modules in the builds, which could perhaps be a problem with older tools. However it unfortunately seems far too complicated/time-consuming for us to attempt to support both the old and modern module formats, hence the alternative would be to do "nothing" here and just keep our "old" builds.[4]
---
[1] The final blocker was module support in workers in Firefox, which was implemented in Firefox 114; please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
[2] It's probably possible to further improve/simplify especially the Node.js-specific code, but it does appear to work as-is.
[3] Having partially "broken" patches, that fail tests, as part of the commit history is *really not* a good idea in general.
[4] Outputting JavaScript modules was first requested almost five years ago, see issue 10317, and nowadays there *should* be much better support for JavaScript modules in various tools.
2023-09-28 20:00:10 +09:00
|
|
|
|
<!--<script src="resource://pdf.js/web/viewer.mjs" type="module"></script>-->
|
2022-12-15 00:40:25 +09:00
|
|
|
|
<!--#endif-->
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body tabindex="1">
|
|
|
|
|
<div id="outerContainer">
|
|
|
|
|
|
|
|
|
|
<div id="mainContainer">
|
|
|
|
|
|
2023-05-15 23:13:41 +09:00
|
|
|
|
<div id="floatingToolbar">
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<button id="download" class="toolbarButton" title="Download" tabindex="31" data-l10n-id="pdfjs-download-button">
|
|
|
|
|
<span data-l10n-id="pdfjs-download-button-label">Download</span>
|
2023-04-24 18:44:43 +09:00
|
|
|
|
</button>
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<button id="openInApp" class="toolbarButton" title="Open in app" tabindex="32" data-l10n-id="pdfjs-open-in-app-button">
|
|
|
|
|
<span data-l10n-id="pdfjs-open-in-app-button-label">Open in app</span>
|
2023-05-05 22:18:01 +09:00
|
|
|
|
</button>
|
2023-04-24 18:44:43 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
2022-12-15 00:40:25 +09:00
|
|
|
|
<div id="viewerContainer" tabindex="0">
|
|
|
|
|
<div id="viewer" class="pdfViewer"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div> <!-- mainContainer -->
|
|
|
|
|
|
|
|
|
|
<div id="dialogContainer">
|
|
|
|
|
<dialog id="passwordDialog">
|
|
|
|
|
<div class="row">
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<label for="password" id="passwordText" data-l10n-id="pdfjs-password-label">Enter the password to open this PDF file:</label>
|
2022-12-15 00:40:25 +09:00
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<input type="password" id="password" class="toolbarField">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="buttonRow">
|
2023-10-13 23:23:17 +09:00
|
|
|
|
<button id="passwordCancel" class="dialogButton"><span data-l10n-id="pdfjs-password-cancel-button">Cancel</span></button>
|
|
|
|
|
<button id="passwordSubmit" class="dialogButton"><span data-l10n-id="pdfjs-password-ok-button">OK</span></button>
|
2022-12-15 00:40:25 +09:00
|
|
|
|
</div>
|
|
|
|
|
</dialog>
|
|
|
|
|
</div> <!-- dialogContainer -->
|
|
|
|
|
|
|
|
|
|
</div> <!-- outerContainer -->
|
2023-03-16 22:22:14 +09:00
|
|
|
|
<div id="printContainer"></div>
|
2022-12-15 00:40:25 +09:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|