pdf-codec 5.3.32 → 5.5.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 (76) hide show
  1. package/README.md +21 -1
  2. package/dist/annotations.d.cts +1 -1
  3. package/dist/annotations.d.ts +1 -1
  4. package/dist/attachments.d.cts +1 -1
  5. package/dist/attachments.d.ts +1 -1
  6. package/dist/cmap.d.cts +1 -1
  7. package/dist/cmap.d.ts +1 -1
  8. package/dist/codec.d.cts +10 -0
  9. package/dist/codec.d.ts +10 -0
  10. package/dist/content-read.d.cts +1 -1
  11. package/dist/content-read.d.ts +1 -1
  12. package/dist/diagnostics-BkG_Ej2x.d.cts +32 -0
  13. package/dist/diagnostics-BkG_Ej2x.d.ts +32 -0
  14. package/dist/diagnostics.cjs +17 -0
  15. package/dist/diagnostics.d.cts +2 -2
  16. package/dist/diagnostics.d.ts +2 -2
  17. package/dist/diagnostics.js +17 -1
  18. package/dist/document.d.cts +1 -1
  19. package/dist/document.d.ts +1 -1
  20. package/dist/encrypt.d.cts +1 -1
  21. package/dist/encrypt.d.ts +1 -1
  22. package/dist/filters.d.cts +1 -1
  23. package/dist/filters.d.ts +1 -1
  24. package/dist/font-read.d.cts +1 -1
  25. package/dist/font-read.d.ts +1 -1
  26. package/dist/form.d.cts +1 -1
  27. package/dist/form.d.ts +1 -1
  28. package/dist/images-read.d.cts +1 -1
  29. package/dist/images-read.d.ts +1 -1
  30. package/dist/index.cjs +6 -0
  31. package/dist/index.d.cts +6 -5
  32. package/dist/index.d.ts +6 -5
  33. package/dist/index.js +5 -4
  34. package/dist/interpret-types.d.cts +1 -1
  35. package/dist/interpret-types.d.ts +1 -1
  36. package/dist/layout.cjs +27 -2
  37. package/dist/layout.d.cts +31 -1
  38. package/dist/layout.d.ts +31 -1
  39. package/dist/layout.js +26 -3
  40. package/dist/names.d.cts +1 -1
  41. package/dist/names.d.ts +1 -1
  42. package/dist/navigation.d.cts +1 -1
  43. package/dist/navigation.d.ts +1 -1
  44. package/dist/optional-content.d.cts +1 -1
  45. package/dist/optional-content.d.ts +1 -1
  46. package/dist/parse.d.cts +1 -1
  47. package/dist/parse.d.ts +1 -1
  48. package/dist/predictors.d.cts +1 -1
  49. package/dist/predictors.d.ts +1 -1
  50. package/dist/raster-text.d.cts +1 -1
  51. package/dist/raster-text.d.ts +1 -1
  52. package/dist/raster.d.cts +1 -1
  53. package/dist/raster.d.ts +1 -1
  54. package/dist/read-convert.d.cts +1 -1
  55. package/dist/read-convert.d.ts +1 -1
  56. package/dist/read.cjs +44 -17
  57. package/dist/read.d.cts +32 -3
  58. package/dist/read.d.ts +32 -3
  59. package/dist/read.js +45 -18
  60. package/dist/structure.cjs +13 -3
  61. package/dist/structure.d.cts +11 -2
  62. package/dist/structure.d.ts +11 -2
  63. package/dist/structure.js +13 -3
  64. package/dist/write-skipped-surfaces.cjs +16 -0
  65. package/dist/write-skipped-surfaces.d.cts +12 -0
  66. package/dist/write-skipped-surfaces.d.ts +12 -0
  67. package/dist/write-skipped-surfaces.js +15 -0
  68. package/dist/write.cjs +17 -0
  69. package/dist/write.d.cts +9 -1
  70. package/dist/write.d.ts +9 -1
  71. package/dist/write.js +17 -1
  72. package/dist/xref.d.cts +1 -1
  73. package/dist/xref.d.ts +1 -1
  74. package/package.json +1 -1
  75. package/dist/diagnostics-C9FxfZ6H.d.cts +0 -22
  76. package/dist/diagnostics-C9FxfZ6H.d.ts +0 -22
package/README.md CHANGED
@@ -93,6 +93,26 @@ An encrypted PDF that opens without a password decrypts transparently — no ext
93
93
 
94
94
  Both accept an optional `signal` (`AbortSignal`); `readPdf` additionally takes a `sink` (`PdfDiagnosticSink`, called once per recoverable parse diagnostic — see the three-tier failure policy under [Conventions](#conventions)), and `writePdf` an `onSubstitution` callback (called once per character not representable in a standard-14 font — see [Fidelity](#fidelity)).
95
95
 
96
+ **Reading a subset of pages.** `readPdf(bytes, { pages: [0, 1, 2, -1] })` reads only the listed pages: zero-based indices into the page tree, a negative index counted from the end (`-1` is the last page). What a selected read skips: an unselected page's content stream is never fetched, decoded or interpreted, so the fonts and images only unselected pages use are never resolved, and no embedded file is decoded, so `attachments` is absent from a page-selected result (an attachment is document-level payload whose size is independent of the pages asked for); an absent `attachments` therefore means "not read" whenever `pageCount` is set, which only a page-selected read does, so check `pageCount` before concluding a document has no attachments. The case this exists for is identifying a document from its first pages, or reading a code from its last page, inside a memory-capped runtime such as a Cloudflare Worker isolate, without paying for every page's content. What it still reads whole, because page references resolve against it or because it is document-level and holds no page content stream: the page tree, the outline, named destinations, optional-content layers, the AcroForm, the structure element tree and the `/ParentTree` number tree (both of which scale with the document), metadata and package residue; every one of those but the page tree and metadata can be left out too, with `surfaces` (below). Two surfaces are built from page content and so cover selected pages only: the structure-ownership association an item's `structure` field names (with its parent-tree diagnostics) and the `page-boxes` residue row. A destination a link states as a direct array is minted into `destinations` (as `dest1`, `dest2`, ...) only when its page is interpreted, so an unselected page's direct link destinations are absent and a minted name depends on which pages were read (and on whether the outline was read, below); named destinations are unaffected. Duplicates collapse and the result's `pages` holds the selected pages in ascending document order, each carrying its source position as `index` (read it through `sourcePageIndex(page, position)`, which falls back to the position on a full read), with the page tree's length as the document's `pageCount`; every document-level page reference keeps naming source indices, so a reference to a selected page resolves through `index`, and one to an unselected page names a page the result does not hold. A full read sets neither field, because there `pages.length` and each page's position already state them. An empty selection is valid and reads no page, which makes `{ pages: [] }` the cheapest way to learn a file's page count and metadata. An entry naming no page (outside `-pageCount` to `pageCount - 1`, or not an integer, `NaN` and the infinities included; `-0` is page 0) throws `PdfPageSelectionError` (a `PdfParseError` with code `pdf/page-out-of-range` or `pdf/page-index-not-integer`, carrying `pageIndex` and `pageCount`) before any page is read. A page-selected `LayoutDocument` is a reading of part of a file, not a document to re-emit: `writePdf` refuses one (any document carrying `pageCount`) with `PdfPartialDocumentError`, since it places pages by position and the references would point at the wrong pages.
97
+
98
+ **Leaving document-level surfaces out.** `readPdf(bytes, { surfaces: { structure: false, outline: false } })` reads the document without the surfaces turned off. `ReadPdfOptions.surfaces` is one object of independent booleans (`ReadPdfSurfaces`), one per surface, each read unless set to `false`, so omitting the setting reads everything exactly as before. It is independent of `pages`, applying to a full read and a page-selected read alike, and combined with a small selection it is what keeps identifying a document cheap: on a long tagged PDF the structure element tree and its `/ParentTree` can be most of what a page-selected read still parses, and `{ pages: [0, 1, 2, -1], surfaces: { outline: false, destinations: false, form: false, layers: false, structure: false, residue: false } }` reads nothing beyond opening the document (cross-reference table, trailer, catalog and any encryption dictionary), the page tree, metadata and those four pages. A surface turned off is never parsed (its part of the catalog is not walked, so a malformed outline, form, layer list or structure tree reports no diagnostic), its `LayoutDocument` field is absent whatever the file holds, and the result names it in `skippedSurfaces` (in the order `LayoutDocumentSurfaceSchema` lists them, absent when every surface was read). An absent `outline`, `destinations`, `form`, `layers`, `structure` or `source` therefore means "not read" whenever `skippedSurfaces` names it, so check `skippedSurfaces` before concluding a document has none, as with `pageCount` and attachments.
99
+
100
+ Each surface, and what page items lose without it (everything else about every page item is exactly what a read with the surface on produces, apart from the renumbering a skipped outline causes):
101
+
102
+ - `outline`: the `/Outlines` bookmark tree (`outline`). Page items do not depend on it, except through minted names. A destination stated as a direct array is named with the first unused `destN` in the order the reader meets it, and the outline is read before any page, so an outline entry's direct destination takes a lower number than any link's. Without the outline, the names minted for page links' direct destinations are renumbered and `destinations` loses the entries only the outline minted, while each link still resolves to the same target.
103
+
104
+ - `destinations`: the named destinations of the catalog `/Dests` dictionary and the `/Names /Dests` name tree, and the registry links and outline entries name their targets through (`destinations`). Without it nothing can name an internal target, so a link whose target is internal (a `/Dest`, or a `/GoTo` action, whether it names a destination or states one directly) is left out of its page's items, and an outline entry, if the outline is read, carries no `destination`. A link to a URI is kept.
105
+
106
+ - `form`: the AcroForm field tree (`form`). Page items do not depend on it, since a widget annotation is never a page item or annotation either way.
107
+
108
+ - `layers`: optional content, the `/OCProperties` groups and their default visibility (`layers`). Without it no item carries a `layer`. The items themselves are all still read, so content the default configuration hides cannot be told from visible content, and a consumer that drops hidden-layer content (as documents.js's reconstruction does) keeps it.
109
+
110
+ - `structure`: the `/StructTreeRoot` element tree and its `/ParentTree` ownership map (`structure`). Without it no item carries a `structure` owner, and the parent-tree diagnostics are not reported.
111
+
112
+ - `residue`: the package-level residue rows (`source`), the per-page `page-boxes` row included. Page items do not depend on it, and `metadata` still reads the XMP packet it falls back to.
113
+
114
+ A `LayoutDocument` read with any surface skipped is a reading with parts of the file deliberately unread, so `writePdf` refuses one (any document carrying `skippedSurfaces`) with `PdfSkippedSurfacesError`, which names the skipped surfaces; a document that is also page-selected reports `PdfPartialDocumentError` first.
115
+
96
116
  **Page boundaries: the crop box is the visible region** (ISO 32000-1 14.11.2). A page's reported `widthPt`/`heightPt` and coordinate frame come from its effective `/CropBox` — the rectangle a viewer displays and prints, inherited through the page tree like `/MediaBox` and defaulting to it — not from the media box: content an author placed outside the crop box (printer's marks, bleed, off-page slugs) is not visible and does not extract. Content wholly outside the crop box is dropped; content straddling the boundary keeps its original unclipped geometry (the item layer records what the file states — a viewer's clipping is a rendering fact, not source data); link annotations are anchored constructs rather than painted content and are never filtered, the same line the optional-content filter draws. The declared boundary rectangles a distinct crop box hides — plus `/BleedBox`/`/TrimBox`/`/ArtBox`, print-production facts with no field in the layout model — are quarantined verbatim as the `page-boxes` package-level residue row rather than silently dropped. A degenerate `/CropBox` (zero width or height) falls back to the media box with a `pdf/invalid-crop-box` warning.
97
117
 
98
118
  **Cancellation granularity and cost, for CPU-metered runtimes.** Both pipelines are synchronous end to end — there is no `await` point for cancellation to hook into implicitly — so the `signal` is checked explicitly, once per page-loop iteration (and once before `readPdf`'s document-open phase begins). A signal aborted mid-parse therefore takes effect at the next page boundary, not instantly: `readPdf`'s document-open phase (cross-reference resolution, object parsing) and a single page's content-stream interpretation are the two spans that cannot be interrupted, and a document consisting of one enormous page is effectively uninterruptible however many pages it claims. Cost is roughly linear in decompressed content length, so budget for the worst single page, not the page count. On Cloudflare Workers this is the honest shape of the trade: the parse holds the isolate for its whole duration with no opportunity to yield or report progress, and an `AbortSignal` shared with whatever can abort concurrently (a binding, another context) makes a deadline enforceable at page granularity — but it cannot convert a synchronous parse into a resumable one. An async page-at-a-time API is a deliberate non-goal of this package's current surface.
@@ -275,7 +295,7 @@ Dependency direction is strictly downward and checkable: `layout` imports only `
275
295
  - **`PdfObject` has no Zod schema at all**, deliberately: it never crosses a public boundary or round-trips through JSON, and is constructed exclusively by this package's own parser. It narrows natively on its own `kind` discriminant.
276
296
  - **The `MathBox`/`MathFontMetrics` family is structurally typed on purpose, not validated by Zod** — the mechanism that lets a caller (`documents.js`) hand this package a real value produced by a completely independent module, with zero cast, zero wrapper, and no shared class or branded type.
277
297
  - **No type assertions anywhere.** Every third-party or loosely-typed value is narrowed through a type guard or a Zod parse at the boundary.
278
- - **A three-tier PDF-read failure policy**: throw a typed `PdfParseError`/`PdfEncryptedError`/`PdfPasswordRequiredError` for a file that cannot be meaningfully processed at all; recover with a `PdfDiagnostic` (`severity: 'warning'`) for something malformed but salvageable; degrade with a diagnostic for an individual unsupported feature while the rest of the document still reads.
298
+ - **A three-tier PDF-read failure policy**: throw a typed `PdfParseError`/`PdfEncryptedError`/`PdfPasswordRequiredError` for a file that cannot be meaningfully processed at all (or `PdfPageSelectionError` for a page selection naming no page of it); recover with a `PdfDiagnostic` (`severity: 'warning'`) for something malformed but salvageable; degrade with a diagnostic for an individual unsupported feature while the rest of the document still reads.
279
299
  - **Conventional commits**, enforced via commitlint + husky.
280
300
 
281
301
  ## Gotchas and quirks
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { r as Matrix } from "./matrix-B7_SBKQ5.cjs";
4
4
  import { PdfObjectResolver } from "./interpret-types.cjs";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { r as Matrix } from "./matrix-B7_SBKQ5.js";
4
4
  import { PdfObjectResolver } from "./interpret-types.js";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { PdfObjectResolver } from "./interpret-types.cjs";
4
4
  import { LayoutAttachment } from "./layout.cjs";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { PdfObjectResolver } from "./interpret-types.js";
4
4
  import { LayoutAttachment } from "./layout.js";
package/dist/cmap.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  //#region src/cmap.d.ts
3
3
  interface ToUnicodeCMap {
4
4
  lookup: (code: number) => string | undefined;
package/dist/cmap.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  //#region src/cmap.d.ts
3
3
  interface ToUnicodeCMap {
4
4
  lookup: (code: number) => string | undefined;
package/dist/codec.d.cts CHANGED
@@ -245,7 +245,9 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
245
245
  }, z.core.$strict>>;
246
246
  }, z.core.$strip>>>;
247
247
  notes: z.ZodOptional<z.ZodString>;
248
+ index: z.ZodOptional<z.ZodNumber>;
248
249
  }, z.core.$strip>>;
250
+ pageCount: z.ZodOptional<z.ZodNumber>;
249
251
  images: z.ZodRecord<z.ZodString, z.ZodObject<{
250
252
  format: z.ZodEnum<{
251
253
  png: "png";
@@ -317,6 +319,14 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
317
319
  }>;
318
320
  xml: z.ZodString;
319
321
  }, z.core.$strict>>>;
322
+ skippedSurfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
323
+ structure: "structure";
324
+ destinations: "destinations";
325
+ outline: "outline";
326
+ layers: "layers";
327
+ form: "form";
328
+ residue: "residue";
329
+ }>>>;
320
330
  }, z.core.$strip>>;
321
331
  //#endregion
322
332
  export { PdfBytesSchema, pdfCodec };
package/dist/codec.d.ts CHANGED
@@ -245,7 +245,9 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
245
245
  }, z.core.$strict>>;
246
246
  }, z.core.$strip>>>;
247
247
  notes: z.ZodOptional<z.ZodString>;
248
+ index: z.ZodOptional<z.ZodNumber>;
248
249
  }, z.core.$strip>>;
250
+ pageCount: z.ZodOptional<z.ZodNumber>;
249
251
  images: z.ZodRecord<z.ZodString, z.ZodObject<{
250
252
  format: z.ZodEnum<{
251
253
  png: "png";
@@ -317,6 +319,14 @@ declare const pdfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
317
319
  }>;
318
320
  xml: z.ZodString;
319
321
  }, z.core.$strict>>>;
322
+ skippedSurfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
323
+ structure: "structure";
324
+ destinations: "destinations";
325
+ outline: "outline";
326
+ layers: "layers";
327
+ form: "form";
328
+ residue: "residue";
329
+ }>>>;
320
330
  }, z.core.$strip>>;
321
331
  //#endregion
322
332
  export { PdfBytesSchema, pdfCodec };
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/content-read.d.ts
4
4
  interface ContentOperation {
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.js";
3
3
  //#region src/content-read.d.ts
4
4
  interface ContentOperation {
@@ -0,0 +1,32 @@
1
+ //#region src/diagnostics.d.ts
2
+ type PdfDiagnosticSeverity = "info" | "warning";
3
+ interface PdfDiagnostic {
4
+ readonly code: string;
5
+ readonly severity: PdfDiagnosticSeverity;
6
+ readonly message: string;
7
+ readonly pageIndex?: number;
8
+ }
9
+ type PdfDiagnosticSink = (diagnostic: PdfDiagnostic) => void;
10
+ declare const NOOP_DIAGNOSTIC_SINK: PdfDiagnosticSink;
11
+ declare class PdfParseError extends Error {
12
+ readonly code: string;
13
+ constructor(code: string, message: string);
14
+ }
15
+ /**
16
+ * A `ReadPdfOptions.pages` entry that names no page of the document: an integer outside `[-pageCount, pageCount - 1]` (code `pdf/page-out-of-range`) or a value that is not an integer at all (code `pdf/page-index-not-integer`). Thrown rather than skipped, because a caller asking for a page it believes exists has a wrong belief about the file, and a result quietly missing that page would let the wrong belief stand.
17
+ *
18
+ * `pageIndex` is the entry exactly as the caller wrote it (negative indices included); `pageCount` is the number of pages the document's page tree holds, so the caller can correct the selection without a second read.
19
+ */
20
+ declare class PdfPageSelectionError extends PdfParseError {
21
+ readonly pageIndex: number;
22
+ readonly pageCount: number;
23
+ constructor(pageIndex: number, pageCount: number);
24
+ }
25
+ declare class PdfEncryptedError extends PdfParseError {
26
+ constructor(message?: string);
27
+ }
28
+ declare class PdfPasswordRequiredError extends PdfParseError {
29
+ constructor(message?: string);
30
+ }
31
+ //#endregion
32
+ export { PdfEncryptedError as a, PdfPasswordRequiredError as c, PdfDiagnosticSink as i, PdfDiagnostic as n, PdfPageSelectionError as o, PdfDiagnosticSeverity as r, PdfParseError as s, NOOP_DIAGNOSTIC_SINK as t };
@@ -0,0 +1,32 @@
1
+ //#region src/diagnostics.d.ts
2
+ type PdfDiagnosticSeverity = "info" | "warning";
3
+ interface PdfDiagnostic {
4
+ readonly code: string;
5
+ readonly severity: PdfDiagnosticSeverity;
6
+ readonly message: string;
7
+ readonly pageIndex?: number;
8
+ }
9
+ type PdfDiagnosticSink = (diagnostic: PdfDiagnostic) => void;
10
+ declare const NOOP_DIAGNOSTIC_SINK: PdfDiagnosticSink;
11
+ declare class PdfParseError extends Error {
12
+ readonly code: string;
13
+ constructor(code: string, message: string);
14
+ }
15
+ /**
16
+ * A `ReadPdfOptions.pages` entry that names no page of the document: an integer outside `[-pageCount, pageCount - 1]` (code `pdf/page-out-of-range`) or a value that is not an integer at all (code `pdf/page-index-not-integer`). Thrown rather than skipped, because a caller asking for a page it believes exists has a wrong belief about the file, and a result quietly missing that page would let the wrong belief stand.
17
+ *
18
+ * `pageIndex` is the entry exactly as the caller wrote it (negative indices included); `pageCount` is the number of pages the document's page tree holds, so the caller can correct the selection without a second read.
19
+ */
20
+ declare class PdfPageSelectionError extends PdfParseError {
21
+ readonly pageIndex: number;
22
+ readonly pageCount: number;
23
+ constructor(pageIndex: number, pageCount: number);
24
+ }
25
+ declare class PdfEncryptedError extends PdfParseError {
26
+ constructor(message?: string);
27
+ }
28
+ declare class PdfPasswordRequiredError extends PdfParseError {
29
+ constructor(message?: string);
30
+ }
31
+ //#endregion
32
+ export { PdfEncryptedError as a, PdfPasswordRequiredError as c, PdfDiagnosticSink as i, PdfDiagnostic as n, PdfPageSelectionError as o, PdfDiagnosticSeverity as r, PdfParseError as s, NOOP_DIAGNOSTIC_SINK as t };
@@ -9,6 +9,22 @@ var PdfParseError = class extends Error {
9
9
  this.code = code;
10
10
  }
11
11
  };
12
+ /**
13
+ * A `ReadPdfOptions.pages` entry that names no page of the document: an integer outside `[-pageCount, pageCount - 1]` (code `pdf/page-out-of-range`) or a value that is not an integer at all (code `pdf/page-index-not-integer`). Thrown rather than skipped, because a caller asking for a page it believes exists has a wrong belief about the file, and a result quietly missing that page would let the wrong belief stand.
14
+ *
15
+ * `pageIndex` is the entry exactly as the caller wrote it (negative indices included); `pageCount` is the number of pages the document's page tree holds, so the caller can correct the selection without a second read.
16
+ */
17
+ var PdfPageSelectionError = class extends PdfParseError {
18
+ pageIndex;
19
+ pageCount;
20
+ constructor(pageIndex, pageCount) {
21
+ const isInteger = Number.isInteger(pageIndex);
22
+ super(isInteger ? "pdf/page-out-of-range" : "pdf/page-index-not-integer", isInteger ? `page index ${pageIndex} names no page of this ${pageCount}-page document; a selection takes zero-based indices from 0 to pageCount - 1, or negative indices from -pageCount to -1 counted from the end` : `page index ${pageIndex} is not an integer; a selection takes zero-based integer page indices`);
23
+ this.name = "PdfPageSelectionError";
24
+ this.pageIndex = pageIndex;
25
+ this.pageCount = pageCount;
26
+ }
27
+ };
12
28
  var PdfEncryptedError = class extends PdfParseError {
13
29
  constructor(message = "this PDF is encrypted and unsupported") {
14
30
  super("pdf/encrypted", message);
@@ -24,5 +40,6 @@ var PdfPasswordRequiredError = class extends PdfParseError {
24
40
  //#endregion
25
41
  exports.NOOP_DIAGNOSTIC_SINK = NOOP_DIAGNOSTIC_SINK;
26
42
  exports.PdfEncryptedError = PdfEncryptedError;
43
+ exports.PdfPageSelectionError = PdfPageSelectionError;
27
44
  exports.PdfParseError = PdfParseError;
28
45
  exports.PdfPasswordRequiredError = PdfPasswordRequiredError;
@@ -1,2 +1,2 @@
1
- import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.cjs";
2
- export { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError };
1
+ import { a as PdfEncryptedError, c as PdfPasswordRequiredError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfPageSelectionError, r as PdfDiagnosticSeverity, s as PdfParseError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-BkG_Ej2x.cjs";
2
+ export { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfPageSelectionError, PdfParseError, PdfPasswordRequiredError };
@@ -1,2 +1,2 @@
1
- import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.js";
2
- export { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError };
1
+ import { a as PdfEncryptedError, c as PdfPasswordRequiredError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfPageSelectionError, r as PdfDiagnosticSeverity, s as PdfParseError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-BkG_Ej2x.js";
2
+ export { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfPageSelectionError, PdfParseError, PdfPasswordRequiredError };
@@ -8,6 +8,22 @@ var PdfParseError = class extends Error {
8
8
  this.code = code;
9
9
  }
10
10
  };
11
+ /**
12
+ * A `ReadPdfOptions.pages` entry that names no page of the document: an integer outside `[-pageCount, pageCount - 1]` (code `pdf/page-out-of-range`) or a value that is not an integer at all (code `pdf/page-index-not-integer`). Thrown rather than skipped, because a caller asking for a page it believes exists has a wrong belief about the file, and a result quietly missing that page would let the wrong belief stand.
13
+ *
14
+ * `pageIndex` is the entry exactly as the caller wrote it (negative indices included); `pageCount` is the number of pages the document's page tree holds, so the caller can correct the selection without a second read.
15
+ */
16
+ var PdfPageSelectionError = class extends PdfParseError {
17
+ pageIndex;
18
+ pageCount;
19
+ constructor(pageIndex, pageCount) {
20
+ const isInteger = Number.isInteger(pageIndex);
21
+ super(isInteger ? "pdf/page-out-of-range" : "pdf/page-index-not-integer", isInteger ? `page index ${pageIndex} names no page of this ${pageCount}-page document; a selection takes zero-based indices from 0 to pageCount - 1, or negative indices from -pageCount to -1 counted from the end` : `page index ${pageIndex} is not an integer; a selection takes zero-based integer page indices`);
22
+ this.name = "PdfPageSelectionError";
23
+ this.pageIndex = pageIndex;
24
+ this.pageCount = pageCount;
25
+ }
26
+ };
11
27
  var PdfEncryptedError = class extends PdfParseError {
12
28
  constructor(message = "this PDF is encrypted and unsupported") {
13
29
  super("pdf/encrypted", message);
@@ -21,4 +37,4 @@ var PdfPasswordRequiredError = class extends PdfParseError {
21
37
  }
22
38
  };
23
39
  //#endregion
24
- export { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError };
40
+ export { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfPageSelectionError, PdfParseError, PdfPasswordRequiredError };
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/document.d.ts
4
4
  interface PdfDocument {
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.js";
3
3
  //#region src/document.d.ts
4
4
  interface PdfDocument {
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/encrypt.d.ts
4
4
  type CipherMethod = "identity" | "rc4" | "aes";
package/dist/encrypt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  //#region src/encrypt.d.ts
4
4
  type CipherMethod = "identity" | "rc4" | "aes";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.cjs";
3
3
  //#region src/filters.d.ts
4
4
  interface DecodedStream {
package/dist/filters.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.js";
3
3
  //#region src/filters.d.ts
4
4
  interface DecodedStream {
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { FontMetricsPort, PdfObjectResolver } from "./interpret-types.cjs";
4
4
  //#region src/font-read.d.ts
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { FontMetricsPort, PdfObjectResolver } from "./interpret-types.js";
4
4
  //#region src/font-read.d.ts
package/dist/form.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { PdfObjectResolver } from "./interpret-types.cjs";
4
4
  import { LayoutFormField } from "./layout.cjs";
package/dist/form.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { PdfObjectResolver } from "./interpret-types.js";
4
4
  import { LayoutFormField } from "./layout.js";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.cjs";
3
3
  import { PdfObjectResolver } from "./interpret-types.cjs";
4
4
  //#region src/images-read.d.ts
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict } from "./objects-e2RS3-yT.js";
3
3
  import { PdfObjectResolver } from "./interpret-types.js";
4
4
  //#region src/images-read.d.ts
package/dist/index.cjs CHANGED
@@ -17,6 +17,7 @@ const require_math_stretch = require("./math-stretch.cjs");
17
17
  const require_math_font = require("./math-font.cjs");
18
18
  const require_font_registry = require("./font-registry.cjs");
19
19
  const require_measure = require("./measure.cjs");
20
+ const require_write_skipped_surfaces = require("./write-skipped-surfaces.cjs");
20
21
  const require_write = require("./write.cjs");
21
22
  const require_codec = require("./codec.cjs");
22
23
  const require_font_face = require("./font-face.cjs");
@@ -37,6 +38,7 @@ exports.LayoutAttachmentSchema = require_layout.LayoutAttachmentSchema;
37
38
  exports.LayoutDestinationSchema = require_layout.LayoutDestinationSchema;
38
39
  exports.LayoutDestinationTargetSchema = require_layout.LayoutDestinationTargetSchema;
39
40
  exports.LayoutDocumentSchema = require_layout.LayoutDocumentSchema;
41
+ exports.LayoutDocumentSurfaceSchema = require_layout.LayoutDocumentSurfaceSchema;
40
42
  exports.LayoutEllipseSchema = require_layout.LayoutEllipseSchema;
41
43
  exports.LayoutFormFieldSchema = require_layout.LayoutFormFieldSchema;
42
44
  exports.LayoutFormWidgetSchema = require_layout.LayoutFormWidgetSchema;
@@ -59,8 +61,11 @@ exports.NOOP_DIAGNOSTIC_SINK = require_diagnostics.NOOP_DIAGNOSTIC_SINK;
59
61
  exports.PdfBytesSchema = require_codec.PdfBytesSchema;
60
62
  exports.PdfEncryptedError = require_diagnostics.PdfEncryptedError;
61
63
  exports.PdfEncryptionError = require_encrypt_write.PdfEncryptionError;
64
+ exports.PdfPageSelectionError = require_diagnostics.PdfPageSelectionError;
62
65
  exports.PdfParseError = require_diagnostics.PdfParseError;
66
+ exports.PdfPartialDocumentError = require_write.PdfPartialDocumentError;
63
67
  exports.PdfPasswordRequiredError = require_diagnostics.PdfPasswordRequiredError;
68
+ exports.PdfSkippedSurfacesError = require_write_skipped_surfaces.PdfSkippedSurfacesError;
64
69
  exports.STANDARD_METRICS = require_afm_widths.STANDARD_METRICS;
65
70
  exports.assembleStretchyGlyph = require_math_stretch.assembleStretchyGlyph;
66
71
  exports.createFontMeasurer = require_measure.createFontMeasurer;
@@ -84,6 +89,7 @@ exports.resolveStandardFont = require_fonts.resolveStandardFont;
84
89
  exports.runGapPt = require_text_group.runGapPt;
85
90
  exports.runsShareBaseline = require_text_group.runsShareBaseline;
86
91
  exports.scaleMathStretchConstruction = require_math_stretch.scaleMathStretchConstruction;
92
+ exports.sourcePageIndex = require_layout.sourcePageIndex;
87
93
  exports.unfilterScanlines = require_image_png_filter.unfilterScanlines;
88
94
  exports.writePdf = require_write.writePdf;
89
95
  var byte_codec = require("byte-codec");
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.cjs";
2
- import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.cjs";
3
- import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.cjs";
2
+ import { a as PdfEncryptedError, c as PdfPasswordRequiredError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfPageSelectionError, r as PdfDiagnosticSeverity, s as PdfParseError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-BkG_Ej2x.cjs";
3
+ import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, sourcePageIndex } from "./layout.cjs";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.cjs";
5
5
  import { PdfBytesSchema, pdfCodec } from "./codec.cjs";
6
6
  import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-CqePfvrl.cjs";
@@ -17,8 +17,9 @@ import { Jpeg2000ProgressionOrder, Jpeg2000QuantizationStyle, Jpeg2000Transform
17
17
  import { Jpeg2000ParseError, Jpeg2000UnsupportedError } from "./image/jpeg2000-errors.cjs";
18
18
  import { Jpeg2000ComponentMetadata, Jpeg2000DecodeOptions, Jpeg2000Image, Jpeg2000Metadata, decodeJpeg2000, readJpeg2000Metadata } from "./image/jpeg2000.cjs";
19
19
  import { filterScanlines, unfilterScanlines } from "./image/png-filter.cjs";
20
- import { ReadPdfOptions, readPdf } from "./read.cjs";
21
- import { WritePdfOptions, writePdf } from "./write.cjs";
20
+ import { ReadPdfOptions, ReadPdfSurfaces, readPdf } from "./read.cjs";
21
+ import { PdfPartialDocumentError, WritePdfOptions, writePdf } from "./write.cjs";
22
+ import { PdfSkippedSurfacesError } from "./write-skipped-surfaces.cjs";
22
23
  import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as MathGlyphVariant, r as MathGlyphConstruction } from "./math-table-gFNB8DmQ.cjs";
23
24
  import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-C2JanDAz.cjs";
24
25
  import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.cjs";
@@ -27,4 +28,4 @@ import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_
27
28
  import { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, renderPdfPage } from "./raster.cjs";
28
29
  import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
29
30
  export * from "byte-codec";
30
- export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, PdfParseError, PdfPasswordRequiredError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, unfilterScanlines, writePdf };
31
+ export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, sourcePageIndex, unfilterScanlines, writePdf };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.js";
2
- import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.js";
3
- import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.js";
2
+ import { a as PdfEncryptedError, c as PdfPasswordRequiredError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfPageSelectionError, r as PdfDiagnosticSeverity, s as PdfParseError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-BkG_Ej2x.js";
3
+ import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, sourcePageIndex } from "./layout.js";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.js";
5
5
  import { PdfBytesSchema, pdfCodec } from "./codec.js";
6
6
  import { n as EmbeddedFaceMetrics, r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-CQZbTTDM.js";
@@ -17,8 +17,9 @@ import { Jpeg2000ProgressionOrder, Jpeg2000QuantizationStyle, Jpeg2000Transform
17
17
  import { Jpeg2000ParseError, Jpeg2000UnsupportedError } from "./image/jpeg2000-errors.js";
18
18
  import { Jpeg2000ComponentMetadata, Jpeg2000DecodeOptions, Jpeg2000Image, Jpeg2000Metadata, decodeJpeg2000, readJpeg2000Metadata } from "./image/jpeg2000.js";
19
19
  import { filterScanlines, unfilterScanlines } from "./image/png-filter.js";
20
- import { ReadPdfOptions, readPdf } from "./read.js";
21
- import { WritePdfOptions, writePdf } from "./write.js";
20
+ import { ReadPdfOptions, ReadPdfSurfaces, readPdf } from "./read.js";
21
+ import { PdfPartialDocumentError, WritePdfOptions, writePdf } from "./write.js";
22
+ import { PdfSkippedSurfacesError } from "./write-skipped-surfaces.js";
22
23
  import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as MathGlyphVariant, r as MathGlyphConstruction } from "./math-table-DhPrNoPa.js";
23
24
  import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-BbC2o4Br.js";
24
25
  import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.js";
@@ -27,4 +28,4 @@ import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_
27
28
  import { PageRasteriser, RasterDrawOp, RasterFillRectOp, RasterFillSpec, RasterImageOp, RasterMatrix, RasterPageGeometry, RasterPathOp, RasterPathSegment, RasterRegionPt, RasterStrokeSpec, RasterSubpath, RenderPdfPageOptions, renderPdfPage } from "./raster.js";
28
29
  import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
29
30
  export * from "byte-codec";
30
- export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, PdfParseError, PdfPasswordRequiredError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, unfilterScanlines, writePdf };
31
+ export { type CcittFaxImage, type CcittFaxOptions, DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, type EmbeddedFace, type EmbeddedFaceMetrics, type EmbeddedFaceSubstitution, type FontFace, FontFaceParseError, type FontMeasurerOptions, type FontMetrics, type FontRegistry, type FontRegistryOptions, type FontSubstitution, type GlyphInkBounds, type Jbig2DecodeOptions, type Jbig2Image, Jbig2ParseError, Jbig2UnsupportedError, type Jp2ChannelDefinition, type Jp2ColourSpace, type Jp2Container, type Jp2ImageHeader, type Jpeg2000ComponentMetadata, type Jpeg2000DecodeOptions, type Jpeg2000Image, type Jpeg2000Metadata, Jpeg2000ParseError, type Jpeg2000ProgressionOrder, type Jpeg2000QuantizationStyle, type Jpeg2000Transform, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutDocumentSurface, LayoutDocumentSurfaceSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, type LoadedMathFont, type MathAssembledGlyphs, type MathBox, type MathColor, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphAssembly, type MathGlyphConstruction, type MathGlyphMetrics, type MathGlyphPart, type MathGlyphPlacement, type MathGlyphRun, type MathGlyphVariant, type MathLayoutItem, type MathRule, type MathStretchAxis, type MathStretchConstruction, type MathStretchGlyph, type MathStretchOptions, type MathStretchPlacement, type MathStretchResult, type MathStroke, type MathVariants, NOOP_DIAGNOSTIC_SINK, type PageRasteriser, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfEncryptionError, type PdfEncryptionOptions, type PdfEncryptionPermissions, type PdfEncryptionScheme, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, PdfSkippedSurfacesError, type PdfTextBox, type PdfTextGroupingOptions, type PdfTextLine, type PdfTextRunGeometry, type PdfTextWord, type PdfWordSeparator, type Point, type PositionedFormula, type ProvidedFont, type RasterDrawOp, type RasterFillRectOp, type RasterFillSpec, type RasterImageOp, type RasterMatrix, type RasterPageGeometry, type RasterPathOp, type RasterPathSegment, type RasterRegionPt, type RasterStrokeSpec, type RasterSubpath, type ReadPdfOptions, type ReadPdfSurfaces, type RenderPdfPageOptions, type ResolvedFace, type ResolvedFont, STANDARD_METRICS, type StandardFontMeasurerOptions, type StandardFontName, type StyledFragment, type StyledRun, type TextMeasurer, type UnderlineMetrics, type VerticalMetricPolicy, type WinAnsiSubstitution, type WrapOptions, type WrappedLine, type WritePdfOptions, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, sourcePageIndex, unfilterScanlines, writePdf };
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import { filterScanlines, unfilterScanlines } from "./image/png-filter.js";
6
6
  import { Jpeg2000ParseError, Jpeg2000UnsupportedError } from "./image/jpeg2000-errors.js";
7
7
  import { looksLikeBareCodestream, parseJp2Container } from "./image/jp2-boxes.js";
8
8
  import { decodeJpeg2000, readJpeg2000Metadata } from "./image/jpeg2000.js";
9
- import { LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema } from "./layout.js";
10
- import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError } from "./diagnostics.js";
9
+ import { LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutDocumentSurfaceSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, sourcePageIndex } from "./layout.js";
10
+ import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfPageSelectionError, PdfParseError, PdfPasswordRequiredError } from "./diagnostics.js";
11
11
  import { resolveStandardFont } from "./fonts.js";
12
12
  import { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_WORD_GAP_EM, groupPdfTextRuns, runGapPt, runsShareBaseline } from "./text-group.js";
13
13
  import { readPdf } from "./read.js";
@@ -16,9 +16,10 @@ import { assembleStretchyGlyph, scaleMathStretchConstruction } from "./math-stre
16
16
  import { loadMathFont } from "./math-font.js";
17
17
  import { createFontRegistry, resolveFaceWithRegistry } from "./font-registry.js";
18
18
  import { DEFAULT_VERTICAL_METRIC_POLICY, createFontMeasurer, createStandardFontMeasurer } from "./measure.js";
19
- import { writePdf } from "./write.js";
19
+ import { PdfSkippedSurfacesError } from "./write-skipped-surfaces.js";
20
+ import { PdfPartialDocumentError, writePdf } from "./write.js";
20
21
  import { PdfBytesSchema, pdfCodec } from "./codec.js";
21
22
  import { FontFaceParseError, readFontFace } from "./font-face.js";
22
23
  import { r as renderPdfPage } from "./raster-DUmwfi3F.js";
23
24
  export * from "byte-codec";
24
- export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, FontFaceParseError, Jbig2ParseError, Jbig2UnsupportedError, Jpeg2000ParseError, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, NOOP_DIAGNOSTIC_SINK, PdfBytesSchema, PdfEncryptedError, PdfEncryptionError, PdfParseError, PdfPasswordRequiredError, STANDARD_METRICS, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, unfilterScanlines, writePdf };
25
+ export { DEFAULT_BASELINE_TOLERANCE_EM, DEFAULT_COLUMN_GAP_EM, DEFAULT_VERTICAL_METRIC_POLICY, DEFAULT_WORD_GAP_EM, FontFaceParseError, Jbig2ParseError, Jbig2UnsupportedError, Jpeg2000ParseError, Jpeg2000UnsupportedError, LAYOUT_FORMAT_VERSION, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachmentSchema, LayoutDestinationSchema, LayoutDestinationTargetSchema, LayoutDocumentSchema, LayoutDocumentSurfaceSchema, LayoutEllipseSchema, LayoutFormFieldSchema, LayoutFormWidgetSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLinkSchema, LayoutItemSchema, LayoutLayerSchema, LayoutLineSchema, LayoutLinkSchema, LayoutOutlineItemSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutStructureElementSchema, LayoutSubpathSchema, LayoutTextSchema, NOOP_DIAGNOSTIC_SINK, PdfBytesSchema, PdfEncryptedError, PdfEncryptionError, PdfPageSelectionError, PdfParseError, PdfPartialDocumentError, PdfPasswordRequiredError, PdfSkippedSurfacesError, STANDARD_METRICS, assembleStretchyGlyph, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, decodeCcittFax, decodeJbig2Embedded, decodeJpeg2000, filterScanlines, groupPdfTextRuns, loadMathFont, looksLikeBareCodestream, parseJp2Container, pdfCodec, readFontFace, readJpeg2000Metadata, readPdf, renderPdfPage, resolveFaceWithRegistry, resolveStandardFont, runGapPt, runsShareBaseline, scaleMathStretchConstruction, sourcePageIndex, unfilterScanlines, writePdf };
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.cjs";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.cjs";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.cjs";
3
3
  import { r as Matrix } from "./matrix-B7_SBKQ5.cjs";
4
4
  import { Color, ContentStrokeStyle } from "document-schema.js";
@@ -1,4 +1,4 @@
1
- import { i as PdfDiagnosticSink } from "./diagnostics-C9FxfZ6H.js";
1
+ import { i as PdfDiagnosticSink } from "./diagnostics-BkG_Ej2x.js";
2
2
  import { n as PdfDict, r as PdfObject } from "./objects-e2RS3-yT.js";
3
3
  import { r as Matrix } from "./matrix-B7_SBKQ5.js";
4
4
  import { Color, ContentStrokeStyle } from "document-schema.js";