pdf-skryba 0.8.0 → 0.9.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.
Files changed (180) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/LICENSE +21 -661
  3. package/README.md +27 -7
  4. package/THIRD-PARTY.md +359 -52
  5. package/dist/first-party/reader.js +14915 -0
  6. package/dist/first-party/reader.js.map +7 -0
  7. package/dist/first-party.js +148 -0
  8. package/dist/first-party.js.map +7 -0
  9. package/dist/index.js +297 -2261
  10. package/dist/index.js.map +4 -4
  11. package/dist/index.min.js +4 -5
  12. package/dist/light.js +23 -305
  13. package/dist/light.js.map +4 -4
  14. package/dist/light.min.js +1 -1
  15. package/dist/types/{packages/doc-read/src/extractor → extractor}/glyph-positions.d.ts +2 -2
  16. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-aside-figures.d.ts +1 -1
  17. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-cell-paragraphs.d.ts +2 -2
  18. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-document-scale.d.ts +3 -3
  19. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-embedded-images.d.ts +1 -1
  20. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-facts.d.ts +1 -1
  21. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-image-anchors.d.ts +1 -1
  22. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-image-refusal.d.ts +1 -1
  23. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-image-store.d.ts +2 -2
  24. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-images.d.ts +1 -1
  25. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-lines.d.ts +2 -2
  26. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-model.d.ts +6 -5
  27. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/refusal.d.ts +1 -1
  28. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objstm-source.d.ts +1 -1
  29. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-ops.d.ts +1 -1
  30. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-figures.d.ts +1 -1
  31. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-markers.d.ts +1 -1
  32. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-stages.d.ts +4 -3
  33. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-tables.d.ts +5 -5
  34. package/dist/types/extractor/pdf-page-tabs.d.ts +4 -0
  35. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-paragraphs.d.ts +2 -2
  36. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-region-order.d.ts +1 -1
  37. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-row-url-join.d.ts +1 -1
  38. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-scanned.d.ts +5 -5
  39. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-source.d.ts +2 -2
  40. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-table-detector.d.ts +3 -3
  41. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-table-render.d.ts +6 -3
  42. package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf.d.ts +3 -3
  43. package/dist/types/{packages/doc-ir/src/layout → layout}/aligned-grid.d.ts +1 -1
  44. package/dist/types/{packages/doc-ir/src/layout → layout}/column-discriminant.d.ts +1 -1
  45. package/dist/types/{packages/doc-ir/src/layout → layout}/cut-word.d.ts +2 -2
  46. package/dist/types/{packages/doc-ir/src/layout → layout}/fragment-cells.d.ts +1 -1
  47. package/dist/types/{packages/doc-ir/src/layout → layout}/geometry.d.ts +3 -2
  48. package/dist/types/{packages/doc-ir/src/layout → layout}/hyphenation.d.ts +1 -1
  49. package/dist/types/{packages/doc-ir/src/layout → layout}/intersection-cells.d.ts +1 -1
  50. package/dist/types/{packages/doc-ir/src/layout → layout}/merged-cells.d.ts +1 -2
  51. package/dist/types/{packages/doc-ir/src/layout → layout}/text-size.d.ts +1 -1
  52. package/dist/types/{packages/doc-ir/src/layout → layout}/vector-grid.d.ts +1 -1
  53. package/dist/types/lib/link-schemes.d.ts +1 -0
  54. package/dist/types/lib/pdf-first-party-reader.d.ts +11 -0
  55. package/dist/types/lib/pdf-first-party.d.ts +7 -0
  56. package/dist/types/lib/pdf-light.d.ts +15 -0
  57. package/dist/types/{packages/doc-read/src/lib → lib}/pdf.d.ts +2 -2
  58. package/dist/types/lib/reader-options.d.ts +12 -0
  59. package/dist/types/lib/table-leading-bands.d.ts +7 -0
  60. package/dist/types/{packages/doc-read/src/pipeline → pipeline}/cut-paragraph-repair.d.ts +1 -1
  61. package/dist/types/{packages/doc-read/src/pipeline → pipeline}/glued-word-repair.d.ts +1 -1
  62. package/dist/types/{packages/doc-read/src/pipeline → pipeline}/lost-text-repair.d.ts +1 -1
  63. package/dist/types/{packages/doc-read/src/pipeline → pipeline}/pdf-conservation-source.d.ts +1 -1
  64. package/package.json +44 -10
  65. package/dist/types/packages/doc-ir/src/extractor/bytes.d.ts +0 -4
  66. package/dist/types/packages/doc-ir/src/extractor/image-format.d.ts +0 -15
  67. package/dist/types/packages/doc-ir/src/extractor/image-pixel-width.d.ts +0 -3
  68. package/dist/types/packages/doc-ir/src/extractor/png-color.d.ts +0 -4
  69. package/dist/types/packages/doc-ir/src/extractor/png-decode.d.ts +0 -8
  70. package/dist/types/packages/doc-ir/src/extractor/png.d.ts +0 -3
  71. package/dist/types/packages/doc-ir/src/extractor/raw-image.d.ts +0 -6
  72. package/dist/types/packages/doc-ir/src/layout/geometry-types.d.ts +0 -65
  73. package/dist/types/packages/doc-ir/src/layout/painted-paths.d.ts +0 -22
  74. package/dist/types/packages/doc-ir/src/layout/rect-rules.d.ts +0 -77
  75. package/dist/types/packages/doc-ir/src/layout/rect.d.ts +0 -14
  76. package/dist/types/packages/doc-ir/src/lib/blanks.d.ts +0 -1
  77. package/dist/types/packages/doc-ir/src/lib/digest.d.ts +0 -1
  78. package/dist/types/packages/doc-ir/src/lib/ir-walk.d.ts +0 -6
  79. package/dist/types/packages/doc-ir/src/lib/ir.d.ts +0 -133
  80. package/dist/types/packages/doc-ir/src/lib/link-schemes.d.ts +0 -5
  81. package/dist/types/packages/doc-ir/src/lib/page-labels.d.ts +0 -10
  82. package/dist/types/packages/doc-ir/src/lib/reader-error.d.ts +0 -14
  83. package/dist/types/packages/doc-ir/src/lib/reader-limits.d.ts +0 -47
  84. package/dist/types/packages/doc-ir/src/lib/reader-types.d.ts +0 -111
  85. package/dist/types/packages/doc-ir/src/lib/symbol-font.d.ts +0 -3
  86. package/dist/types/packages/doc-ir/src/lib/table-empty-parts.d.ts +0 -16
  87. package/dist/types/packages/doc-ir/src/lib/table-width-cap.d.ts +0 -7
  88. package/dist/types/packages/doc-ir/src/lib/vision-port.d.ts +0 -16
  89. package/dist/types/packages/doc-ir/src/pipeline/detect-language.d.ts +0 -13
  90. package/dist/types/packages/doc-ir/src/pipeline/language-profiles.d.ts +0 -8
  91. package/dist/types/packages/doc-ir/src/pipeline/text-conservation.d.ts +0 -89
  92. package/dist/types/packages/doc-read/src/extractor/pdf-page-tabs.d.ts +0 -4
  93. package/dist/types/packages/doc-read/src/lib/pdf-light.d.ts +0 -15
  94. package/dist/types/packages/doc-read/src/lib/reader-options.d.ts +0 -12
  95. /package/dist/types/{packages/doc-read/src/extractor → extractor}/codecs/ccitt-fax.d.ts +0 -0
  96. /package/dist/types/{packages/doc-read/src/extractor → extractor}/codecs/ccitt-run-tables.d.ts +0 -0
  97. /package/dist/types/{packages/doc-read/src/extractor → extractor}/document-cache.d.ts +0 -0
  98. /package/dist/types/{packages/doc-read/src/extractor → extractor}/extraction-cost.d.ts +0 -0
  99. /package/dist/types/{packages/doc-read/src/extractor → extractor}/font-weight.d.ts +0 -0
  100. /package/dist/types/{packages/doc-read/src/extractor → extractor}/glyph-accents.d.ts +0 -0
  101. /package/dist/types/{packages/doc-read/src/extractor → extractor}/glyph-double-draw.d.ts +0 -0
  102. /package/dist/types/{packages/doc-read/src/extractor → extractor}/glyph-runs.d.ts +0 -0
  103. /package/dist/types/{packages/doc-read/src/extractor → extractor}/glyph-window.d.ts +0 -0
  104. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-bands.d.ts +0 -0
  105. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-ccitt-images.d.ts +0 -0
  106. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-colour-ours.d.ts +0 -0
  107. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-column-cut.d.ts +0 -0
  108. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-decrypt.d.ts +0 -0
  109. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-document-info.d.ts +0 -0
  110. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-flate-images.d.ts +0 -0
  111. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-font-bridge.d.ts +0 -0
  112. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-font-objects.d.ts +0 -0
  113. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/bounds.d.ts +0 -0
  114. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/cns-cmap-data.d.ts +0 -0
  115. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/font-text.d.ts +0 -0
  116. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/glyph-data.d.ts +0 -0
  117. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/jis-cmap-data.d.ts +0 -0
  118. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/names.d.ts +0 -0
  119. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/predefined-cmaps.d.ts +0 -0
  120. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/table-budget.d.ts +0 -0
  121. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/to-unicode.d.ts +0 -0
  122. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/type1-encoding.d.ts +0 -0
  123. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-fonts/widths.d.ts +0 -0
  124. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-framed-blocks.d.ts +0 -0
  125. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-glyph-source.d.ts +0 -0
  126. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-hidden-text.d.ts +0 -0
  127. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-image-pixels.d.ts +0 -0
  128. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-jpeg-images.d.ts +0 -0
  129. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-layers.d.ts +0 -0
  130. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-letter-spacing.d.ts +0 -0
  131. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-line-breaks.d.ts +0 -0
  132. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-links-ours.d.ts +0 -0
  133. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-links.d.ts +0 -0
  134. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/bounds.d.ts +0 -0
  135. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/content.d.ts +0 -0
  136. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/document.d.ts +0 -0
  137. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/objects.d.ts +0 -0
  138. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/parse.d.ts +0 -0
  139. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/streams.d.ts +0 -0
  140. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-objects/xref.d.ts +0 -0
  141. /package/dist/types/{packages/doc-gate/src/extractor → extractor}/pdf-objstm-guard.d.ts +0 -0
  142. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-open.d.ts +0 -0
  143. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-ops-ours.d.ts +0 -0
  144. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-outline.d.ts +0 -0
  145. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-content.d.ts +0 -0
  146. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-page-plan.d.ts +0 -0
  147. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-paths-ours.d.ts +0 -0
  148. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-reading-order.d.ts +0 -0
  149. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-reference-ours.d.ts +0 -0
  150. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-rotated-lines.d.ts +0 -0
  151. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-rotated-words.d.ts +0 -0
  152. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-smask.d.ts +0 -0
  153. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-stencil-images.d.ts +0 -0
  154. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-structure.d.ts +0 -0
  155. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-symbol-page.d.ts +0 -0
  156. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-symbol-verdict.d.ts +0 -0
  157. /package/dist/types/{packages/doc-read/src/extractor → extractor}/pdf-text-string.d.ts +0 -0
  158. /package/dist/types/{packages/doc-read/src/extractor → extractor}/text-writing-direction.d.ts +0 -0
  159. /package/dist/types/{packages/doc-ir/src/layout → layout}/baseline-lines.d.ts +0 -0
  160. /package/dist/types/{packages/doc-ir/src/layout → layout}/cell-text.d.ts +0 -0
  161. /package/dist/types/{packages/doc-ir/src/layout → layout}/column-grid.d.ts +0 -0
  162. /package/dist/types/{packages/doc-ir/src/layout → layout}/grid-band.d.ts +0 -0
  163. /package/dist/types/{packages/doc-ir/src/layout → layout}/gutter.d.ts +0 -0
  164. /package/dist/types/{packages/doc-ir/src/layout → layout}/heading-sizes.d.ts +0 -0
  165. /package/dist/types/{packages/doc-ir/src/layout → layout}/hidden-repaints.d.ts +0 -0
  166. /package/dist/types/{packages/doc-ir/src/layout → layout}/hyphenation-en.d.ts +0 -0
  167. /package/dist/types/{packages/doc-ir/src/layout → layout}/hyphenation-fr.d.ts +0 -0
  168. /package/dist/types/{packages/doc-ir/src/layout → layout}/image-frontier.d.ts +0 -0
  169. /package/dist/types/{packages/doc-ir/src/layout → layout}/induced-markers.d.ts +0 -0
  170. /package/dist/types/{packages/doc-ir/src/layout → layout}/intervals.d.ts +0 -0
  171. /package/dist/types/{packages/doc-ir/src/layout → layout}/list.d.ts +0 -0
  172. /package/dist/types/{packages/doc-ir/src/layout → layout}/mode.d.ts +0 -0
  173. /package/dist/types/{packages/doc-ir/src/layout → layout}/page-furniture.d.ts +0 -0
  174. /package/dist/types/{packages/doc-ir/src/layout → layout}/position-clusters.d.ts +0 -0
  175. /package/dist/types/{packages/doc-ir/src/layout → layout}/straddled-boundaries.d.ts +0 -0
  176. /package/dist/types/{packages/doc-ir/src/layout → layout}/superscript.d.ts +0 -0
  177. /package/dist/types/{packages/doc-ir/src/layout → layout}/tolerances.d.ts +0 -0
  178. /package/dist/types/{packages/doc-ir/src/layout → layout}/word-gap.d.ts +0 -0
  179. /package/dist/types/{packages/doc-read/src/lib → lib}/chunk.d.ts +0 -0
  180. /package/dist/types/{packages/doc-ir/src/lib → lib}/extent.d.ts +0 -0
package/README.md CHANGED
@@ -21,11 +21,14 @@ ES modules only, for Node.js 24 or later; the types ship with the package. From
21
21
  // read.ts: node read.js report.pdf
22
22
  import { readFileSync } from "node:fs";
23
23
  import { extractPdf } from "pdf-skryba";
24
- import { ReaderError } from "pdf-skryba/light";
24
+ import type { ReaderError } from "pdf-skryba/light";
25
25
 
26
26
  const path = process.argv[2];
27
27
  if (path === undefined) throw new Error("usage: node read.js <file.pdf>");
28
28
 
29
+ // A refusal is told by its name: that holds whichever entry, and whichever copy of the package, threw it.
30
+ const isRefusal = (error: unknown): error is ReaderError => error instanceof Error && error.name === "ReaderError";
31
+
29
32
  // No AI reading here: with `ocr: false`, a page without a text layer is counted, never sent.
30
33
  const vision = { analyzeDocument: () => Promise.reject(new Error("no AI reading configured")) };
31
34
 
@@ -36,7 +39,7 @@ try {
36
39
  if (pages?.kind === "tabs") console.log(`blocks on page 1: ${pages.tabs[0]?.blocks.length ?? 0}`);
37
40
  console.log(`notices: ${notices?.length ?? 0}`);
38
41
  } catch (error) {
39
- if (!(error instanceof ReaderError)) throw error;
42
+ if (!isRefusal(error)) throw error;
40
43
  console.error(`refused: ${error.code}`);
41
44
  process.exitCode = 1;
42
45
  }
@@ -88,13 +91,14 @@ await extractPdf(bytes, vision, {
88
91
 
89
92
  ## Refusals carry a code
90
93
 
91
- ```js
92
- import { ReaderError } from "pdf-skryba/light";
94
+ A refusal is an `Error` named `ReaderError`. Tell it by that name: it holds whichever entry, and
95
+ whichever copy of the package, threw the error. `pdf-skryba/light` exports the type.
93
96
 
97
+ ```js
94
98
  try {
95
99
  await extractPdf(bytes, vision, { ocr: false });
96
100
  } catch (error) {
97
- if (error instanceof ReaderError) {
101
+ if (error instanceof Error && error.name === "ReaderError") {
98
102
  error.code; // "SCANNED_PDF_NEEDS_AI_OCR", "FILE_UNSAFE", "EXTRACT_FAILED"…
99
103
  error.pageCount; // what it knew before refusing
100
104
  }
@@ -155,15 +159,31 @@ Four entries, two of them the minified twins of the others.
155
159
  representation (`IRDoc`, `IRBlock`, `TableData`…).
156
160
  - `pdf-skryba/min` and `pdf-skryba/light/min` — the same code, minified.
157
161
 
162
+ ## Publisher-only entries
163
+
164
+ The sub-paths under `pdf-skryba/first-party` exist for the publisher's own application. They are
165
+ **not a public API**: they may change or disappear in any version, and Semantic Versioning does not
166
+ cover them. The source is open, so nothing stops you from importing them; if you do, pin an exact
167
+ version.
168
+
158
169
  ## Versioning
159
170
 
160
171
  The package follows [Semantic Versioning](https://semver.org): while it is `0.x`, a minor version
161
172
  may break the published surface, and a patch never does. Each release is described in
162
173
  `CHANGELOG.md`, shipped in the package.
163
174
 
175
+ ## Contributing and security
176
+
177
+ See `CONTRIBUTING.md` and `SECURITY.md` in the
178
+ [repository](https://github.com/numiastowski-design/pdf-skryba). A contribution is received under
179
+ the MIT licence of the repository. Author: Miksumia.
180
+
164
181
  ## Licence
165
182
 
166
- AGPL-3.0-or-later: run a modified version as a network service and its source must be available to its
167
- users. Named `skryba` until 0.6.2. Since 0.7.0 the code comes readable (`dist/index.js`), with the same code minified beside
183
+ MIT (`LICENSE`), from version 0.9.0. Versions up to 0.8.0 stay under AGPL-3.0-or-later. The bundle
184
+ carries third-party material under its own notices (`THIRD-PARTY.md`). The test documents of the
185
+ repository are not under the MIT licence: each keeps its own, written in `fixtures/**/SOURCES.md`.
186
+
187
+ Named `skryba` until 0.6.2. Since 0.7.0 the code comes readable (`dist/index.js`), with the same code minified beside
168
188
  it (`pdf-skryba/min`). This package ships a bundle and its source map. The Corresponding Source is published at
169
189
  <https://github.com/numiastowski-design/pdf-skryba>, as one snapshot for each released version.
package/THIRD-PARTY.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # Third-party notices
2
2
 
3
- This package is AGPL-3.0-or-later. It also **redistributes** material owned by others, inside
4
- `dist/index.js`, and carries their notices here.
3
+ This package is under the MIT licence (`LICENSE`). Its bundle (`dist/`) also **redistributes**
4
+ material owned by others, each under its own permissive licence. Their notices are carried here,
5
+ as those licences ask. The MIT licence covers the rest.
5
6
 
6
7
  ## Adobe CMap resources: `UniCNS-UCS2-H` and `UniJIS-UCS2-H`, code → CID
7
8
 
8
9
  `dist/index.js` carries the code → CID tables of Adobe's `UniCNS-UCS2-H` (collection Adobe-CNS1) and
9
- `UniJIS-UCS2-H` (Adobe-Japan1) CMaps, transcribed into three sixteen-bit columns by
10
- `tools/poc/build-cns-cmap.ts` from Adobe's own resources — nothing is taken from any reader. Source:
11
- `adobe-type-tools/cmap-resources`. Their notice:
10
+ `UniJIS-UCS2-H` (Adobe-Japan1) CMaps, transcribed into three sixteen-bit columns from Adobe's own
11
+ resources — nothing is taken from any reader. Source: `adobe-type-tools/cmap-resources`. Their notice:
12
12
 
13
13
  > Copyright 1990-2019 Adobe. All rights reserved.
14
14
  >
@@ -32,14 +32,100 @@ This package is AGPL-3.0-or-later. It also **redistributes** material owned by o
32
32
 
33
33
  **What is carried and what is not.** The 16 418 `cidrange` entries of the Chinese table and the 8 533 of the
34
34
  Japanese one, whole and exact — neither resource holds a `cidchar` block or a `usecmap`, so nothing is
35
- inherited from another file (the generator refuses loudly if either ever appears). Left out: the codespace
36
- declaration (`<0000>–<D7FF>`, `<E000>–<FFFF>`), which the reader already applies by cutting two-byte codes;
37
- and the single `notdefrange` of each (`<0000>–<001F>` → CID 1), the C0 control characters, which this product
38
- never publishes anyway.
35
+ inherited from another file. Left out: the codespace declaration (`<0000>–<D7FF>`, `<E000>–<FFFF>`), which the
36
+ reader already applies by cutting two-byte codes; and the single `notdefrange` of each (`<0000>–<001F>` →
37
+ CID 1), the C0 control characters.
39
38
 
40
- Until 1/11/2026 the bundle embedded instead the predefined CMaps of pdf.js (`pdfjs-dist/cmaps/*.bcmap`), ~594 KB
41
- for every collection; they left with pdf.js. A PDF that relies on any OTHER predefined CMap (`90ms-RKSJ-H`,
42
- `ETen-B5-H`, the GB and KS collections) falls back on the font's own default width `/DW`, and says so in its tests.
39
+ A PDF that relies on any OTHER predefined CMap (`90ms-RKSJ-H`, `ETen-B5-H`, the GB and KS collections) falls
40
+ back on the font's own default width `/DW`.
41
+
42
+ ## Adobe Glyph List
43
+
44
+ `dist/index.js` carries the glyph name → Unicode table of the Adobe Glyph List (`glyphlist.txt`), packed
45
+ into one string, and the glyph names of the PDF encodings read through it. The Symbol table of the base
46
+ (`doc-ir`) is built from the same list. Source: `adobe-type-tools/agl-aglfn`. Its notice (BSD 3-Clause):
47
+
48
+ > Copyright 2002-2019 Adobe (http://www.adobe.com/).
49
+ >
50
+ > Redistribution and use in source and binary forms, with or without modification, are permitted provided
51
+ > that the following conditions are met:
52
+ >
53
+ > Redistributions of source code must retain the above copyright notice, this list of conditions and the
54
+ > following disclaimer.
55
+ >
56
+ > Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
57
+ > following disclaimer in the documentation and/or other materials provided with the distribution.
58
+ >
59
+ > Neither the name of Adobe nor the names of its contributors may be used to endorse or promote products
60
+ > derived from this software without specific prior written permission.
61
+ >
62
+ > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
63
+ > WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
64
+ > PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
65
+ > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
66
+ > PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67
+ > HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
68
+ > NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
69
+ > POSSIBILITY OF SUCH DAMAGE.
70
+
71
+ ## Adobe Font Metrics of the 14 standard PDF fonts (APAFML)
72
+
73
+ `dist/index.js` carries the advance widths of the 14 standard fonts, by glyph name, and the built-in
74
+ encodings of Helvetica, Symbol and ZapfDingbats, all read from Adobe's Core 14 AFM files. The AFM files
75
+ themselves are not distributed. Their notice (SPDX `APAFML`):
76
+
77
+ > Copyright (c) 1985, 1987, 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights
78
+ > Reserved.
79
+ >
80
+ > This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any
81
+ > purpose and without charge, with or without modification, provided that all copyright notices are
82
+ > retained; that the AFM files are not distributed without this file; that all modifications to this file
83
+ > or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not
84
+ > modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files.
85
+
86
+ **Modification, noted as the notice asks.** Only the widths and the encoding slots are kept, rewritten as
87
+ `name=width` lists and arrays of names; every other AFM field (kerning, bounding boxes, composites) is left
88
+ out.
89
+
90
+ ## Code page tables (WinAnsi, MacRoman)
91
+
92
+ The glyph names of `WinAnsiEncoding` and `MacRomanEncoding` are derived from two mapping tables published
93
+ by the Unicode Consortium: `CP1252.TXT` (cp1252 to Unicode, Microsoft) and `ROMAN.TXT` (Mac OS Roman to
94
+ Unicode, © 1994-2002, 2005 Apple Computer, Inc.). Neither file is redistributed: each code was turned into
95
+ a glyph name through the Adobe Glyph List.
96
+
97
+ ## Hyphenation patterns (hyph-utf8): American English and French
98
+
99
+ `dist/index.js` carries the Knuth-Liang hyphenation patterns of the `hyph-utf8` package for American
100
+ English (`hyph-en-us.tex`, 2005-05-30) and French (`hyph-fr.tex`, V2.13 2016/05/12). The TeX comments are
101
+ stripped and the tokens joined by spaces; the tokens themselves are unmodified.
102
+
103
+ American English (the file holds the additional patterns of its author together with the original
104
+ patterns of the Plain TeX `hyphen.tex`). Its notice:
105
+
106
+ > Copyright (C) 1990, 2004, 2005 Gerard D.C. Kuiken
107
+ >
108
+ > Copying and distribution of this file, with or without modification, are permitted in any medium without
109
+ > royalty provided the copyright notice and this notice are preserved.
110
+
111
+ French. Its notice (MIT):
112
+
113
+ > Copyright (C) 1994-2002 Daniel Flipo, Bernard Gaulle, 2016 Arthur Reutenauer
114
+ >
115
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
116
+ > associated documentation files (the "Software"), to deal in the Software without restriction, including
117
+ > without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ > copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
119
+ > following conditions:
120
+ >
121
+ > The above copyright notice and this permission notice shall be included in all copies or substantial
122
+ > portions of the Software.
123
+ >
124
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
125
+ > LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
126
+ > EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
127
+ > IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
128
+ > USE OR OTHER DEALINGS IN THE SOFTWARE.
43
129
 
44
130
  ## PDFium, CCITT fax decoding
45
131
 
@@ -51,16 +137,46 @@ notice, in each file:
51
137
  > Copyright 2014 The PDFium Authors. Use of this source code is governed by a BSD-style license
52
138
  > that can be found in the LICENSE file. Original code copyright 2014 Foxit Software Inc.
53
139
 
54
- The licence text is PDFium's own (BSD-3-Clause, Google Inc. and the PDFium Authors). Redistribution
55
- is permitted under it, provided this notice and the copyright line travel with the code. They do.
140
+ The licence text is PDFium's own (BSD 3-Clause, Google Inc. and the PDFium Authors), reproduced whole:
141
+
142
+ ```
143
+ // Copyright 2014 The PDFium Authors
144
+ //
145
+ // Redistribution and use in source and binary forms, with or without
146
+ // modification, are permitted provided that the following conditions are
147
+ // met:
148
+ //
149
+ // * Redistributions of source code must retain the above copyright
150
+ // notice, this list of conditions and the following disclaimer.
151
+ // * Redistributions in binary form must reproduce the above
152
+ // copyright notice, this list of conditions and the following disclaimer
153
+ // in the documentation and/or other materials provided with the
154
+ // distribution.
155
+ // * Neither the name of Google Inc. nor the names of its
156
+ // contributors may be used to endorse or promote products derived from
157
+ // this software without specific prior written permission.
158
+ //
159
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
160
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
161
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
162
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
163
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
164
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
165
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
166
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
167
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
168
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
169
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
170
+ ```
56
171
 
57
172
  ## JPEG decoder (jpeg-js 0.4.4), vendored
58
173
 
59
174
  `dist/index.js` carries the decoder of jpeg-js 0.4.4, kept as published in
60
- `src/extractor/codecs/vendor/jpeg-js-decoder.cjs`, with one function added (`decodeRaw`: the four-component
61
- components before colour conversion). The decoding code is jpgjs, copyright 2011 notmasteryet, under the
62
- Apache License 2.0 (its notice is in the file). The jpeg-js package is under the BSD 3-Clause licence below
63
- (Copyright (c) 2014, Eugene Ware).
175
+ `src/extractor/codecs/vendor/jpeg-js-decoder.cjs`. **Changed file, as the Apache licence asks to say:**
176
+ one function is added at its end (`decodeRaw`: the components before colour conversion), marked as
177
+ added in the file. The decoding code is jpgjs, copyright 2011 notmasteryet, under the Apache License 2.0
178
+ (its notice is in the file; the licence text is at the end of this document). The jpeg-js package is
179
+ under the BSD 3-Clause licence below.
64
180
 
65
181
  ```
66
182
  Copyright (c) 2014, Eugene Ware
@@ -90,45 +206,236 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
90
206
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91
207
  ```
92
208
 
209
+ ## pdf.js: DeviceCMYK conversion and Symbol table
210
+
211
+ `dist/index.js` carries the polynomial that turns DeviceCMYK into RGB (`src/extractor/pdf-colour-ours.ts`,
212
+ `cmykBytes`), whose coefficients are those of pdf.js (`src/core/colorspace.js`), and the Symbol code →
213
+ Unicode table of the base (`doc-ir`), generated once from the tables of pdf.js. pdf.js is under the Apache
214
+ License 2.0 (text at the end of this document). Its notice:
215
+
216
+ > Copyright 2012 Mozilla Foundation
217
+ >
218
+ > Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
219
+ > compliance with the License. You may obtain a copy of the License at
220
+ >
221
+ > http://www.apache.org/licenses/LICENSE-2.0
222
+ >
223
+ > Unless required by applicable law or agreed to in writing, software distributed under the License is
224
+ > distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225
+ > See the License for the specific language governing permissions and limitations under the License.
226
+
93
227
  ## Dependencies, not redistributed
94
228
 
95
- These are **not** in the bundle; a consumer installs them and their licences apply to their own
96
- copies: `parse5` (MIT), `@cantoo/pdf-lib` (MIT).
229
+ This one is **not** in the bundle; a consumer installs it and its licence applies to their own copy:
230
+ `@cantoo/pdf-lib` (MIT).
97
231
 
98
- ## Why this file exists
232
+ ## Test documents
99
233
 
100
- A licence scanner reads the registry metadata, which says AGPL only, and a reader of the README
101
- has no reason to suspect embedded resources. Found by the security review of 30/10/2026, before
102
- the first publication — which would have been irreversible.
234
+ The test documents of the repository are not part of the package and are not under the MIT licence. Each
235
+ keeps its own licence, written in the `SOURCES.md` of its folder (`fixtures/**/SOURCES.md`).
103
236
 
104
- ### PDFium licence (verbatim, BSD part)
237
+ ## Apache License 2.0 (text)
105
238
 
106
239
  ```
107
- // Copyright 2014 The PDFium Authors
108
- //
109
- // Redistribution and use in source and binary forms, with or without
110
- // modification, are permitted provided that the following conditions are
111
- // met:
112
- //
113
- // * Redistributions of source code must retain the above copyright
114
- // notice, this list of conditions and the following disclaimer.
115
- // * Redistributions in binary form must reproduce the above
116
- // copyright notice, this list of conditions and the following disclaimer
117
- // in the documentation and/or other materials provided with the
118
- // distribution.
119
- // * Neither the name of Google Inc. nor the names of its
120
- // contributors may be used to endorse or promote products derived from
121
- // this software without specific prior written permission.
122
- //
123
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
124
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
125
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
126
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
127
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
128
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
129
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
130
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
131
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
132
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
133
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
240
+ Apache License
241
+ Version 2.0, January 2004
242
+ http://www.apache.org/licenses/
243
+
244
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
245
+
246
+ 1. Definitions.
247
+
248
+ "License" shall mean the terms and conditions for use, reproduction,
249
+ and distribution as defined by Sections 1 through 9 of this document.
250
+
251
+ "Licensor" shall mean the copyright owner or entity authorized by
252
+ the copyright owner that is granting the License.
253
+
254
+ "Legal Entity" shall mean the union of the acting entity and all
255
+ other entities that control, are controlled by, or are under common
256
+ control with that entity. For the purposes of this definition,
257
+ "control" means (i) the power, direct or indirect, to cause the
258
+ direction or management of such entity, whether by contract or
259
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
260
+ outstanding shares, or (iii) beneficial ownership of such entity.
261
+
262
+ "You" (or "Your") shall mean an individual or Legal Entity
263
+ exercising permissions granted by this License.
264
+
265
+ "Source" form shall mean the preferred form for making modifications,
266
+ including but not limited to software source code, documentation
267
+ source, and configuration files.
268
+
269
+ "Object" form shall mean any form resulting from mechanical
270
+ transformation or translation of a Source form, including but
271
+ not limited to compiled object code, generated documentation,
272
+ and conversions to other media types.
273
+
274
+ "Work" shall mean the work of authorship, whether in Source or
275
+ Object form, made available under the License, as indicated by a
276
+ copyright notice that is included in or attached to the work
277
+ (an example is provided in the Appendix below).
278
+
279
+ "Derivative Works" shall mean any work, whether in Source or Object
280
+ form, that is based on (or derived from) the Work and for which the
281
+ editorial revisions, annotations, elaborations, or other modifications
282
+ represent, as a whole, an original work of authorship. For the purposes
283
+ of this License, Derivative Works shall not include works that remain
284
+ separable from, or merely link (or bind by name) to the interfaces of,
285
+ the Work and Derivative Works thereof.
286
+
287
+ "Contribution" shall mean any work of authorship, including
288
+ the original version of the Work and any modifications or additions
289
+ to that Work or Derivative Works thereof, that is intentionally
290
+ submitted to Licensor for inclusion in the Work by the copyright owner
291
+ or by an individual or Legal Entity authorized to submit on behalf of
292
+ the copyright owner. For the purposes of this definition, "submitted"
293
+ means any form of electronic, verbal, or written communication sent
294
+ to the Licensor or its representatives, including but not limited to
295
+ communication on electronic mailing lists, source code control systems,
296
+ and issue tracking systems that are managed by, or on behalf of, the
297
+ Licensor for the purpose of discussing and improving the Work, but
298
+ excluding communication that is conspicuously marked or otherwise
299
+ designated in writing by the copyright owner as "Not a Contribution."
300
+
301
+ "Contributor" shall mean Licensor and any individual or Legal Entity
302
+ on behalf of whom a Contribution has been received by Licensor and
303
+ subsequently incorporated within the Work.
304
+
305
+ 2. Grant of Copyright License. Subject to the terms and conditions of
306
+ this License, each Contributor hereby grants to You a perpetual,
307
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
308
+ copyright license to reproduce, prepare Derivative Works of,
309
+ publicly display, publicly perform, sublicense, and distribute the
310
+ Work and such Derivative Works in Source or Object form.
311
+
312
+ 3. Grant of Patent License. Subject to the terms and conditions of
313
+ this License, each Contributor hereby grants to You a perpetual,
314
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
315
+ (except as stated in this section) patent license to make, have made,
316
+ use, offer to sell, sell, import, and otherwise transfer the Work,
317
+ where such license applies only to those patent claims licensable
318
+ by such Contributor that are necessarily infringed by their
319
+ Contribution(s) alone or by combination of their Contribution(s)
320
+ with the Work to which such Contribution(s) was submitted. If You
321
+ institute patent litigation against any entity (including a
322
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
323
+ or a Contribution incorporated within the Work constitutes direct
324
+ or contributory patent infringement, then any patent licenses
325
+ granted to You under this License for that Work shall terminate
326
+ as of the date such litigation is filed.
327
+
328
+ 4. Redistribution. You may reproduce and distribute copies of the
329
+ Work or Derivative Works thereof in any medium, with or without
330
+ modifications, and in Source or Object form, provided that You
331
+ meet the following conditions:
332
+
333
+ (a) You must give any other recipients of the Work or
334
+ Derivative Works a copy of this License; and
335
+
336
+ (b) You must cause any modified files to carry prominent notices
337
+ stating that You changed the files; and
338
+
339
+ (c) You must retain, in the Source form of any Derivative Works
340
+ that You distribute, all copyright, patent, trademark, and
341
+ attribution notices from the Source form of the Work,
342
+ excluding those notices that do not pertain to any part of
343
+ the Derivative Works; and
344
+
345
+ (d) If the Work includes a "NOTICE" text file as part of its
346
+ distribution, then any Derivative Works that You distribute must
347
+ include a readable copy of the attribution notices contained
348
+ within such NOTICE file, excluding those notices that do not
349
+ pertain to any part of the Derivative Works, in at least one
350
+ of the following places: within a NOTICE text file distributed
351
+ as part of the Derivative Works; within the Source form or
352
+ documentation, if provided along with the Derivative Works; or,
353
+ within a display generated by the Derivative Works, if and
354
+ wherever such third-party notices normally appear. The contents
355
+ of the NOTICE file are for informational purposes only and
356
+ do not modify the License. You may add Your own attribution
357
+ notices within Derivative Works that You distribute, alongside
358
+ or as an addendum to the NOTICE text from the Work, provided
359
+ that such additional attribution notices cannot be construed
360
+ as modifying the License.
361
+
362
+ You may add Your own copyright statement to Your modifications and
363
+ may provide additional or different license terms and conditions
364
+ for use, reproduction, or distribution of Your modifications, or
365
+ for any such Derivative Works as a whole, provided Your use,
366
+ reproduction, and distribution of the Work otherwise complies with
367
+ the conditions stated in this License.
368
+
369
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
370
+ any Contribution intentionally submitted for inclusion in the Work
371
+ by You to the Licensor shall be under the terms and conditions of
372
+ this License, without any additional terms or conditions.
373
+ Notwithstanding the above, nothing herein shall supersede or modify
374
+ the terms of any separate license agreement you may have executed
375
+ with Licensor regarding such Contributions.
376
+
377
+ 6. Trademarks. This License does not grant permission to use the trade
378
+ names, trademarks, service marks, or product names of the Licensor,
379
+ except as required for reasonable and customary use in describing the
380
+ origin of the Work and reproducing the content of the NOTICE file.
381
+
382
+ 7. Disclaimer of Warranty. Unless required by applicable law or
383
+ agreed to in writing, Licensor provides the Work (and each
384
+ Contributor provides its Contributions) on an "AS IS" BASIS,
385
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
386
+ implied, including, without limitation, any warranties or conditions
387
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
388
+ PARTICULAR PURPOSE. You are solely responsible for determining the
389
+ appropriateness of using or redistributing the Work and assume any
390
+ risks associated with Your exercise of permissions under this License.
391
+
392
+ 8. Limitation of Liability. In no event and under no legal theory,
393
+ whether in tort (including negligence), contract, or otherwise,
394
+ unless required by applicable law (such as deliberate and grossly
395
+ negligent acts) or agreed to in writing, shall any Contributor be
396
+ liable to You for damages, including any direct, indirect, special,
397
+ incidental, or consequential damages of any character arising as a
398
+ result of this License or out of the use or inability to use the
399
+ Work (including but not limited to damages for loss of goodwill,
400
+ work stoppage, computer failure or malfunction, or any and all
401
+ other commercial damages or losses), even if such Contributor
402
+ has been advised of the possibility of such damages.
403
+
404
+ 9. Accepting Warranty or Additional Liability. While redistributing
405
+ the Work or Derivative Works thereof, You may choose to offer,
406
+ and charge a fee for, acceptance of support, warranty, indemnity,
407
+ or other liability obligations and/or rights consistent with this
408
+ License. However, in accepting such obligations, You may act only
409
+ on Your own behalf and on Your sole responsibility, not on behalf
410
+ of any other Contributor, and only if You agree to indemnify,
411
+ defend, and hold each Contributor harmless for any liability
412
+ incurred by, or claims asserted against, such Contributor by reason
413
+ of your accepting any such warranty or additional liability.
414
+
415
+ END OF TERMS AND CONDITIONS
416
+
417
+ APPENDIX: How to apply the Apache License to your work.
418
+
419
+ To apply the Apache License to your work, attach the following
420
+ boilerplate notice, with the fields enclosed by brackets "[]"
421
+ replaced with your own identifying information. (Don't include
422
+ the brackets!) The text should be enclosed in the appropriate
423
+ comment syntax for the file format. We also recommend that a
424
+ file or class name and description of purpose be included on the
425
+ same "printed page" as the copyright notice for easier
426
+ identification within third-party archives.
427
+
428
+ Copyright [yyyy] [name of copyright owner]
429
+
430
+ Licensed under the Apache License, Version 2.0 (the "License");
431
+ you may not use this file except in compliance with the License.
432
+ You may obtain a copy of the License at
433
+
434
+ http://www.apache.org/licenses/LICENSE-2.0
435
+
436
+ Unless required by applicable law or agreed to in writing, software
437
+ distributed under the License is distributed on an "AS IS" BASIS,
438
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
439
+ See the License for the specific language governing permissions and
440
+ limitations under the License.
134
441
  ```