@file-viewer/renderer-pdf 2.3.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -51,3 +51,5 @@ When no explicit PDF asset URL is configured, the renderer first uses the public
51
51
  ## Migration Note
52
52
 
53
53
  PDF rendering has moved out of `@file-viewer/core` into this package, and `pdfjs-dist` is now declared only by `@file-viewer/renderer-pdf`. Installing core or a standard component package no longer pulls PDF.js; explicitly assemble this renderer when PDF preview is needed, or use `@file-viewer/preset-all`.
54
+
55
+ The published renderer stages its Apache-2.0 PDF.js runtime under `dist/vendor/pdfjs` and isolates PDF.js' internal webpack bootstrap before packing. `provenance.json` records each upstream source hash, transform count, and staged output hash, so webpack 4 consumers do not need a loader for renderer-internal paths.
package/README.md CHANGED
@@ -51,3 +51,5 @@ const options = {
51
51
  ## 迁移说明
52
52
 
53
53
  PDF 渲染已经从 `@file-viewer/core` 移入本包,`pdfjs-dist` 只由 `@file-viewer/renderer-pdf` 声明。只安装 core 或标准组件包时不会再拉取 PDF.js;需要 PDF 预览时请显式装配本 renderer,或使用 `@file-viewer/preset-all`。
54
+
55
+ 发布产物会把 Apache-2.0 的 PDF.js runtime 内封到 `dist/vendor/pdfjs`,并在打包前隔离 PDF.js 内部 webpack bootstrap。`provenance.json` 会记录每个上游源文件哈希、变换次数和产物哈希,因此 webpack 4 消费项目不需要再为 renderer 内部路径配置 loader。
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import { type FileRenderHandler, type FileViewerRenderedInstance, type FileViewerRendererPlugin, type RendererDefinition } from '@file-viewer/core';
2
+ export { getFileViewerPdfIdentityFontRepair, registerFileViewerPdfIdentityFontRepair, } from './optionalCapabilities.js';
3
+ export type { FileViewerPdfIdentityFontRepair } from './optionalCapabilities.js';
4
+ export type { PdfIdentityFontRepairResult } from './pdfIdentityFontRepair.js';
2
5
  export declare const pdfRendererDefinition: RendererDefinition;
3
6
  export declare const renderFileViewerPdf: FileRenderHandler<FileViewerRenderedInstance, HTMLDivElement>;
4
7
  export declare const pdfRenderer: FileViewerRendererPlugin<FileRenderHandler<FileViewerRenderedInstance, HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';
2
+ export { getFileViewerPdfIdentityFontRepair, registerFileViewerPdfIdentityFontRepair, } from './optionalCapabilities.js';
2
3
  const pdfDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'pdf');
3
4
  if (!pdfDefinition) {
4
5
  throw new Error('@file-viewer/renderer-pdf could not locate the core PDF renderer definition.');
@@ -0,0 +1,4 @@
1
+ import type { PdfIdentityFontRepairResult } from './pdfIdentityFontRepair.js';
2
+ export type FileViewerPdfIdentityFontRepair = (sourceBytes: Uint8Array, candidateFamilies?: readonly string[]) => Promise<PdfIdentityFontRepairResult>;
3
+ export declare const registerFileViewerPdfIdentityFontRepair: (repair: FileViewerPdfIdentityFontRepair | null) => void;
4
+ export declare const getFileViewerPdfIdentityFontRepair: () => FileViewerPdfIdentityFontRepair | null;
@@ -0,0 +1,5 @@
1
+ let identityFontRepair = null;
2
+ export const registerFileViewerPdfIdentityFontRepair = (repair) => {
3
+ identityFontRepair = repair;
4
+ };
5
+ export const getFileViewerPdfIdentityFontRepair = () => identityFontRepair;
package/dist/pdf.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getDocument, GlobalWorkerOptions, PDFWorker as PdfJsWorker, PixelsPerInch, version as pdfJsVersion, } from 'pdfjs-dist/legacy/build/pdf.mjs';
2
- import { EventBus, GenericL10n, PDFFindController, PDFLinkService, PDFViewer, } from 'pdfjs-dist/legacy/web/pdf_viewer.mjs';
1
+ import { getDocument, GlobalWorkerOptions, PDFWorker as PdfJsWorker, PixelsPerInch, version as pdfJsVersion, } from './vendor/pdfjs/legacy/build/pdf.mjs';
2
+ import { EventBus, GenericL10n, PDFFindController, PDFLinkService, PDFViewer, } from './vendor/pdfjs/legacy/web/pdf_viewer.mjs';
3
3
  import { registerFileViewerSearchProvider, registerFileViewerZoomProvider, unregisterFileViewerSearchProvider, unregisterFileViewerZoomProvider, registerFileViewerViewStateProvider, unregisterFileViewerViewStateProvider, createFileViewerZoomChangeEmitter, createFileViewerViewStateChange, createFileViewerViewStateChangeEmitter, createFileViewerTranslator, buildPrintPageStyle, formatCssPixels, DEFAULT_PDF_RANGE_CHUNK_SIZE, resolveFileViewerLocale, resolveFileViewerFitScale, } from '@file-viewer/core';
4
4
  import { DEFAULT_FILE_VIEWER_PDF_WORKER_PATH, resolveFileViewerPdfAssetUrls, resolveFileViewerRuntimeAssetBaseUrl, } from '@file-viewer/core/assets';
5
5
  import { pdfViewerStyle } from './pdfStyles.js';
@@ -9,6 +9,8 @@ import { createPdfBoundingBoxController, } from './pdfBboxController.js';
9
9
  import { clampPdfScale, normalizePdfRotation, resolvePdfViewStateUpdate, } from './pdfViewState.js';
10
10
  import { capturePdfJsWorkerGlobal, scopePdfJsWorkerMessageHandler, } from './pdfWorkerGlobal.js';
11
11
  import { readPdfJsWorkerVersion } from './pdfWorkerVersion.js';
12
+ import { getFileViewerPdfIdentityFontRepair } from './optionalCapabilities.js';
13
+ import { isExpectedPdfJsDestroyConsoleError } from './pdfConsoleLifecycle.js';
12
14
  export const DEFAULT_FILE_VIEWER_PDF_WORKER_URL = DEFAULT_FILE_VIEWER_PDF_WORKER_PATH;
13
15
  const MIN_SCALE = 0.2;
14
16
  const MAX_SCALE = 3;
@@ -111,22 +113,7 @@ const waitForPaint = (view) => new Promise(resolve => {
111
113
  }
112
114
  globalThis.setTimeout(resolve, 0);
113
115
  });
114
- const readErrorLikeMessage = (value) => {
115
- if (value instanceof Error) {
116
- return value.message;
117
- }
118
- if (value && typeof value === 'object' && 'message' in value) {
119
- return String(value.message || '');
120
- }
121
- return String(value || '');
122
- };
123
- const isPdfJsDestroyedTransportPageInitError = (args) => {
124
- const [message, reason] = args;
125
- return typeof message === 'string' &&
126
- /^Unable to get page \d+ to initialize viewer$/.test(message) &&
127
- readErrorLikeMessage(reason).includes('Transport destroyed');
128
- };
129
- const suppressPdfJsDestroyedTransportPageInitErrors = (view) => {
116
+ const suppressPdfJsDestroyLifecycleErrors = (view) => {
130
117
  const consoleRef = (view.console ||
131
118
  globalThis.console);
132
119
  if (!consoleRef || typeof consoleRef.error !== 'function') {
@@ -138,7 +125,7 @@ const suppressPdfJsDestroyedTransportPageInitErrors = (view) => {
138
125
  suppression = {
139
126
  originalError,
140
127
  patchedError: (...args) => {
141
- if (isPdfJsDestroyedTransportPageInitError(args)) {
128
+ if (isExpectedPdfJsDestroyConsoleError(args)) {
142
129
  return;
143
130
  }
144
131
  return originalError.apply(consoleRef, args);
@@ -252,7 +239,7 @@ const readResponsePrefix = async (response, maximumBytes = PDF_WORKER_VERSION_PR
252
239
  return (await response.text()).slice(0, maximumBytes);
253
240
  };
254
241
  const loadBundledPdfWorkerModule = async () => {
255
- bundledPdfWorkerModulePromise !== null && bundledPdfWorkerModulePromise !== void 0 ? bundledPdfWorkerModulePromise : (bundledPdfWorkerModulePromise = import('pdfjs-dist/legacy/build/pdf.worker.mjs'));
242
+ bundledPdfWorkerModulePromise !== null && bundledPdfWorkerModulePromise !== void 0 ? bundledPdfWorkerModulePromise : (bundledPdfWorkerModulePromise = import('./vendor/pdfjs/legacy/build/pdf.worker.mjs'));
256
243
  return bundledPdfWorkerModulePromise;
257
244
  };
258
245
  const createBundledPdfFakeWorker = async () => {
@@ -1568,7 +1555,7 @@ export default async function renderPdf(buffer, target, context) {
1568
1555
  if (!resource) {
1569
1556
  return;
1570
1557
  }
1571
- const restorePdfJsConsoleErrors = suppressPdfJsDestroyedTransportPageInitErrors(targetWindow);
1558
+ const restorePdfJsConsoleErrors = suppressPdfJsDestroyLifecycleErrors(targetWindow);
1572
1559
  try {
1573
1560
  await resource.loadingTask.destroy();
1574
1561
  }
@@ -1883,12 +1870,15 @@ export default async function renderPdf(buffer, target, context) {
1883
1870
  }
1884
1871
  }
1885
1872
  const candidateFamilies = detectMalformedIdentityCjkFontFamilies(firstPageTextContent, fontName => malformedFontFamilies.get(fontName) || '');
1886
- if (candidateFamilies.length) {
1873
+ const identityFontRepair = getFileViewerPdfIdentityFontRepair();
1874
+ if (candidateFamilies.length && !identityFontRepair) {
1875
+ console.warn('[file-viewer] This PDF needs the optional Identity-font repair capability. Run `npx file-viewer-cli add pdf-identity-font-repair --write`, then `npx file-viewer-cli install --yes`.');
1876
+ }
1877
+ if (candidateFamilies.length && identityFontRepair) {
1887
1878
  let replacementResource = null;
1888
1879
  try {
1889
1880
  const sourceBytes = await pdfDocument.getData();
1890
- const { repairMalformedIdentityCjkFonts } = await import('./pdfIdentityFontRepair.js');
1891
- const repaired = await repairMalformedIdentityCjkFonts(sourceBytes, candidateFamilies);
1881
+ const repaired = await identityFontRepair(sourceBytes, candidateFamilies);
1892
1882
  if (repaired.repairedFonts > 0) {
1893
1883
  const previousResource = resource;
1894
1884
  replacementResource = await createLoadingResource({ data: repaired.bytes });
@@ -2035,7 +2025,7 @@ export default async function renderPdf(buffer, target, context) {
2035
2025
  return {
2036
2026
  $el: root,
2037
2027
  unmount() {
2038
- var _a, _b;
2028
+ var _a, _b, _c, _d;
2039
2029
  destroyed = true;
2040
2030
  loadVersion += 1;
2041
2031
  restorePdfJsMissingSystemFontWarnings();
@@ -2059,6 +2049,8 @@ export default async function renderPdf(buffer, target, context) {
2059
2049
  (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, null);
2060
2050
  (_b = context === null || context === void 0 ? void 0 : context.registerThumbnailAdapter) === null || _b === void 0 ? void 0 : _b.call(context, null);
2061
2051
  const resource = pdfContext.resource;
2052
+ (_c = pdfContext.viewer) === null || _c === void 0 ? void 0 : _c.setDocument(null);
2053
+ (_d = pdfContext.linkService) === null || _d === void 0 ? void 0 : _d.setDocument(null, null);
2062
2054
  pdfContext.viewer = null;
2063
2055
  pdfContext.linkService = null;
2064
2056
  pdfContext.eventBus = null;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * PDF.js can finish an already queued page task after File Viewer has started
3
+ * tearing the document down. A queued `forceRendering` callback can also run
4
+ * after PDFViewer has reset its old page views and report that the old
5
+ * `pdfPage` is no longer loaded. Only silence those exact message/reason pairs
6
+ * inside File Viewer's scoped teardown window. All parsing, rendering, worker
7
+ * and network errors remain visible.
8
+ */
9
+ export declare const isExpectedPdfJsDestroyConsoleError: (args: unknown[]) => boolean;
@@ -0,0 +1,29 @@
1
+ const readErrorLikeMessage = (value) => {
2
+ if (value instanceof Error) {
3
+ return value.message;
4
+ }
5
+ if (value && typeof value === 'object' && 'message' in value) {
6
+ return String(value.message || '');
7
+ }
8
+ return String(value || '');
9
+ };
10
+ const isPdfJsDestroyLifecycleMessage = (message) => /^Unable to get page \d+ to initialize viewer$/.test(message) ||
11
+ message === 'Unable to get page for page view' ||
12
+ message === 'renderView:';
13
+ /**
14
+ * PDF.js can finish an already queued page task after File Viewer has started
15
+ * tearing the document down. A queued `forceRendering` callback can also run
16
+ * after PDFViewer has reset its old page views and report that the old
17
+ * `pdfPage` is no longer loaded. Only silence those exact message/reason pairs
18
+ * inside File Viewer's scoped teardown window. All parsing, rendering, worker
19
+ * and network errors remain visible.
20
+ */
21
+ export const isExpectedPdfJsDestroyConsoleError = (args) => {
22
+ const [message, reason] = args;
23
+ if (typeof message !== 'string' || !isPdfJsDestroyLifecycleMessage(message)) {
24
+ return false;
25
+ }
26
+ const reasonMessage = readErrorLikeMessage(reason);
27
+ return reasonMessage === 'Transport destroyed' ||
28
+ (message === 'renderView:' && reasonMessage === 'pdfPage is not loaded');
29
+ };
@@ -0,0 +1,2 @@
1
+ /** @internal Shared only with the source-level regression tests. */
2
+ export declare const normalizePdfIdentityFontFamily: (value: string) => string;
@@ -0,0 +1,57 @@
1
+ const MAX_PDF_IDENTITY_FONT_NAME_CHARACTERS = 1024;
2
+ const PDF_FONT_STYLE_NAMES = new Set([
3
+ 'bold',
4
+ 'regular',
5
+ 'italic',
6
+ 'oblique',
7
+ 'medium',
8
+ 'semibold',
9
+ 'demibold',
10
+ 'light',
11
+ 'black',
12
+ 'thin',
13
+ ]);
14
+ const isFontNameSeparator = (character) => character === ',' || character === '_' || character === '-' || character.trim() === '';
15
+ const hasSubsetPrefix = (value) => {
16
+ if (value.length < 7 || value[6] !== '+')
17
+ return false;
18
+ for (let index = 0; index < 6; index += 1) {
19
+ const codePoint = value.charCodeAt(index) | 0x20;
20
+ if (codePoint < 0x61 || codePoint > 0x7a)
21
+ return false;
22
+ }
23
+ return true;
24
+ };
25
+ const stripFontStyleSuffix = (value) => {
26
+ let cursor = 0;
27
+ while (cursor < value.length) {
28
+ if (!isFontNameSeparator(value[cursor])) {
29
+ cursor += 1;
30
+ continue;
31
+ }
32
+ const separatorStart = cursor;
33
+ while (cursor < value.length && isFontNameSeparator(value[cursor]))
34
+ cursor += 1;
35
+ const tokenStart = cursor;
36
+ while (cursor < value.length && !isFontNameSeparator(value[cursor]))
37
+ cursor += 1;
38
+ const token = value.slice(tokenStart, cursor).toLowerCase();
39
+ const style = token.endsWith('mt') ? token.slice(0, -2) : token;
40
+ if (PDF_FONT_STYLE_NAMES.has(style))
41
+ return value.slice(0, separatorStart);
42
+ }
43
+ return value;
44
+ };
45
+ /** @internal Shared only with the source-level regression tests. */
46
+ export const normalizePdfIdentityFontFamily = (value) => {
47
+ if (!value || value.length > MAX_PDF_IDENTITY_FONT_NAME_CHARACTERS)
48
+ return '';
49
+ const withoutSubset = hasSubsetPrefix(value) ? value.slice(7) : value;
50
+ const withoutStyle = stripFontStyleSuffix(withoutSubset);
51
+ const normalizedCharacters = [];
52
+ for (const character of withoutStyle.normalize('NFKC').toLowerCase()) {
53
+ if (!isFontNameSeparator(character))
54
+ normalizedCharacters.push(character);
55
+ }
56
+ return normalizedCharacters.join('');
57
+ };
@@ -1,4 +1,5 @@
1
1
  import { decodePDFRawStream, PDFArray, PDFDict, PDFDocument, PDFHexString, PDFName, PDFNumber, PDFRawStream, PDFString, } from 'pdf-lib';
2
+ import { normalizePdfIdentityFontFamily } from './pdfIdentityFontName.js';
2
3
  const MAX_REPAIR_SOURCE_BYTES = 64 * 1024 * 1024;
3
4
  const MAX_TTF_TABLES = 256;
4
5
  const MAX_CMAP_GLYPHS = 0xffff;
@@ -62,12 +63,7 @@ const readTag = (bytes, offset) => {
62
63
  return String.fromCharCode(bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3]);
63
64
  };
64
65
  const normalizeFontFamily = (value) => {
65
- const withoutSubset = value.replace(/^[A-Z]{6}\+/i, '');
66
- const withoutStyle = withoutSubset.replace(/(?:[\s,_-]+)(?:bold|regular|italic|oblique|medium|semibold|demibold|light|black|thin)(?:mt)?(?:[\s,_-].*)?$/i, '');
67
- const normalized = withoutStyle
68
- .normalize('NFKC')
69
- .toLowerCase()
70
- .replace(/[\s,_-]+/g, '');
66
+ const normalized = normalizePdfIdentityFontFamily(value);
71
67
  return CJK_FONT_FAMILY_ALIASES[normalized] || normalized;
72
68
  };
73
69
  const isCjkFontFamily = (family) => {
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,7 @@
1
+ PDF.js browser runtime
2
+
3
+ Package: pdfjs-dist@5.4.624
4
+ Source: https://github.com/mozilla/pdf.js
5
+ License: Apache-2.0 (see LICENSE)
6
+
7
+ The upstream npm package does not contain a standalone NOTICE file.