@file-viewer/renderer-pdf 2.4.0 → 3.0.1
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 +3 -1
- package/README.md +3 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/optionalCapabilities.d.ts +4 -0
- package/dist/optionalCapabilities.js +5 -0
- package/dist/pdf.js +18 -26
- package/dist/pdfConsoleLifecycle.d.ts +9 -0
- package/dist/pdfConsoleLifecycle.js +29 -0
- package/dist/pdfIdentityFontName.d.ts +2 -0
- package/dist/pdfIdentityFontName.js +57 -0
- package/dist/pdfIdentityFontRepair.js +2 -6
- package/dist/vendor/pdfjs/LICENSE +177 -0
- package/dist/vendor/pdfjs/NOTICE +7 -0
- package/dist/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/dist/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/dist/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/dist/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/vendor/pdfjs/legacy/build/pdf.mjs +32800 -0
- package/dist/vendor/pdfjs/legacy/build/pdf.worker.mjs +67372 -0
- package/dist/vendor/pdfjs/legacy/web/pdf_viewer.mjs +14448 -0
- package/dist/vendor/pdfjs/provenance.json +52 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +102 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +22 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/dist/vendor/pdfjs/wasm/jbig2.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/dist/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/file-viewer.capability.json +29 -0
- package/package.json +25 -7
package/README.en.md
CHANGED
|
@@ -44,10 +44,12 @@ const options = {
|
|
|
44
44
|
|
|
45
45
|
When no explicit PDF asset URL is configured, the renderer first uses the public base exposed by build tools such as Vite and can fall back to the page entry script. An app deployed under `/workspace/` therefore still requests `/workspace/vendor/pdf/pdf.worker.mjs` while its current SPA route is `/workspace/c/`. UMI, custom proxies, and builds whose public path cannot be detected can set `pdf.assetBaseUrl: '/workspace/'` to pin the base for every PDF offline asset. Before creating a static Worker, the renderer reads the official PDF.js version marker; a stale Worker from an older deployment is rejected and the packaged same-version handler is used instead. If the host app did not run `file-viewer-copy-assets`, does not use `@file-viewer/vite-plugin`, or a local dev server falls back to HTML for that path, the same fallback prevents `Setting up fake worker failed`. For best performance, complete cMap/standard-font/WASM decoding, or strict offline deployments, still copy viewer assets and point these URLs at real static files. The pinned PDF.js 5.4 stable line loads local JBIG2, JPEG 2000, color-management, and related helpers through `wasmUrl`; viewer assets and the Vite plugin copy them without relying on the public internet.
|
|
46
46
|
|
|
47
|
-
`cjkFontFallback` is enabled by default. When a PDF references `MicrosoftYaHei-Bold`, SimSun, SimHei, or another CJK font without embedding the font program, the renderer prefers an installed system font and otherwise aliases the original PDF font name to the
|
|
47
|
+
`cjkFontFallback` is enabled by default. When a PDF references `MicrosoftYaHei-Bold`, SimSun, SimHei, or another CJK font without embedding the font program, the renderer prefers an installed system font and otherwise aliases the original PDF font name to the local Noto Sans SC variable font supplied by `@file-viewer/assets-standard`. The Vite plugin reuses that standard asset set instead of packing a second font copy into the renderer. Only WOFF2 shards needed by the current page text are loaded. The first page waits for the font before rendering, and later pages are redrawn when they introduce new glyphs. Set the option to `false` to disable this behavior, or point `cjkFontFallbackPath` at a self-hosted directory with the same structure.
|
|
48
48
|
|
|
49
49
|
`identityFontRepair` is also enabled by default for malformed PDFs that write TrueType glyph IDs through `Identity-H`/`Identity-V` but omit `ToUnicode`. The repair module is loaded only after CJK font substitution and multiple control-character glyphs are detected. If the same PDF embeds a usable same-family TrueType font, its cmap is used to rebuild the Unicode mapping for the in-memory preview. The repair is applied only to a preview copy and never overwrites the original file or download source; an unsafe or unsupported repair falls back to the original preview. Set the option to `false` to disable this compatibility path.
|
|
50
50
|
|
|
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
|
@@ -44,10 +44,12 @@ const options = {
|
|
|
44
44
|
|
|
45
45
|
默认未显式配置时,渲染器优先使用 Vite 等构建器提供的公开基址,并可从页面入口脚本回退识别部署子路径。因此应用部署在 `/workspace/`、当前 SPA 路由为 `/workspace/c/` 时,仍会请求 `/workspace/vendor/pdf/pdf.worker.mjs`。UMI、自定义代理或无法自动识别的构建环境可以设置 `pdf.assetBaseUrl: '/workspace/'` 固定全部 PDF 离线资源的基址。创建静态 Worker 前会先读取 PDF.js 官方版本标记;若部署目录残留的旧 Worker 与当前 API 不一致,会拒绝旧文件并自动使用包内同版本 handler。项目未执行 `file-viewer-copy-assets`、未使用 `@file-viewer/vite-plugin`,或本地临时服务器把该路径回退成 HTML 时,也会使用同一兜底,避免 `Setting up fake worker failed` 直接中断预览。需要最佳性能、完整 cMap/standard fonts/WASM 解码或严格离线部署时,仍建议复制 viewer assets 并配置真实静态地址。当前锁定的 PDF.js 5.4 稳定线会通过 `wasmUrl` 本地加载 JBIG2、JPEG 2000、颜色管理等辅助资源;这些资源由 viewer assets 和 Vite 插件统一复制,不依赖公网。
|
|
46
46
|
|
|
47
|
-
`cjkFontFallback` 默认开启。PDF 引用了 `MicrosoftYaHei-Bold`、宋体、黑体或其他中文字体但没有嵌入字体数据时,渲染器优先使用本机字体;本机缺失时,会把原 PDF
|
|
47
|
+
`cjkFontFallback` 默认开启。PDF 引用了 `MicrosoftYaHei-Bold`、宋体、黑体或其他中文字体但没有嵌入字体数据时,渲染器优先使用本机字体;本机缺失时,会把原 PDF 字体名映射到 `@file-viewer/assets-standard` 提供的本地 Noto Sans SC 可变字体,并根据当前页实际文字只加载需要的 WOFF2 分片。Vite 插件会优先复用这份标准资源,避免在 renderer 中重复打包字体。首屏会在字体就绪后再渲染,后续页发现新字形时会自动重绘。可设为 `false` 完全关闭,或用 `cjkFontFallbackPath` 指向同结构的自托管字体目录。
|
|
48
48
|
|
|
49
49
|
`identityFontRepair` 也默认开启,用于少数把 TrueType 字形 ID 写入 `Identity-H`/`Identity-V`、却遗漏 `ToUnicode` 的异常 PDF。只有检测到中文字体替换和多个控制字符乱码时,渲染器才会懒加载修复模块;若文件内同时嵌入了可用的同族 TrueType 字体,就从其 cmap 重建内存预览所需的 Unicode 映射。修复只作用于预览副本,不覆盖原始文件和下载源;无法安全修复时继续使用原预览。可设为 `false` 关闭。
|
|
50
50
|
|
|
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;
|
package/dist/pdf.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getDocument, GlobalWorkerOptions, PDFWorker as PdfJsWorker, PixelsPerInch, version as pdfJsVersion, } from 'pdfjs
|
|
2
|
-
import { EventBus, GenericL10n, PDFFindController, PDFLinkService, PDFViewer, } from 'pdfjs
|
|
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
|
|
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 (
|
|
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
|
|
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 () => {
|
|
@@ -805,7 +792,7 @@ export default async function renderPdf(buffer, target, context) {
|
|
|
805
792
|
'改用包内同版本 PDF.js handler。');
|
|
806
793
|
}
|
|
807
794
|
const shouldUseRealWorker = !!(targetWindow === null || targetWindow === void 0 ? void 0 : targetWindow.Worker) && (workerProbe.status === 'compatible' ||
|
|
808
|
-
(hasExplicitWorkerUrl && workerProbe.status
|
|
795
|
+
(hasExplicitWorkerUrl && workerProbe.status === 'unknown'));
|
|
809
796
|
if (shouldUseRealWorker) {
|
|
810
797
|
GlobalWorkerOptions.workerSrc = workerUrl;
|
|
811
798
|
try {
|
|
@@ -1568,7 +1555,7 @@ export default async function renderPdf(buffer, target, context) {
|
|
|
1568
1555
|
if (!resource) {
|
|
1569
1556
|
return;
|
|
1570
1557
|
}
|
|
1571
|
-
const restorePdfJsConsoleErrors =
|
|
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
|
-
|
|
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
|
|
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,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
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|