js.documents 14.6.1 → 14.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -405,7 +405,7 @@ Every reconstructed node's frames name the page's index in the source PDF (the s
405
405
 
406
406
  ### Leaving a PDF's document-level surfaces out
407
407
 
408
- The same entry points take a `surfaces` option (`PdfToDocumentOptions.surfaces`, `UnifiedConversionOptions.surfaces`, `ReadNativeDocumentTreeOptions.surfaces`): pdf-codec's `ReadPdfOptions.surfaces` threaded through, one boolean per document-level surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`), each read unless set to `false`, so omitting it converts exactly as before. It is independent of `pages`, and `convertDocument` hands it to the same hop `pages` goes to, so an intermediate pdf a route renders internally is always read whole. Combined with a small page selection it is what keeps identifying a document from a few pages cheap on a long tagged PDF, whose structure tree and `/ParentTree` a page selection alone still parses whole.
408
+ The same entry points take a `surfaces` option (`PdfToDocumentOptions.surfaces`, `UnifiedConversionOptions.surfaces`, `ReadNativeDocumentTreeOptions.surfaces`): pdf-codec's `ReadPdfOptions.surfaces` threaded through, one boolean per document-level surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`, `images`), each read unless set to `false`, so omitting it converts exactly as before. It is independent of `pages`, and `convertDocument` hands it to the same hop `pages` goes to, so an intermediate pdf a route renders internally is always read whole. Combined with a small page selection it is what keeps identifying a document from a few pages cheap on a long tagged PDF, whose structure tree and `/ParentTree` a page selection alone still parses whole.
409
409
 
410
410
  ```ts
411
411
  import { pdfToMarkdown } from "documents.js/read";
@@ -419,13 +419,14 @@ const firstPages = pdfToMarkdown(pdfBytes, {
419
419
  layers: false,
420
420
  structure: false,
421
421
  residue: false,
422
+ images: false,
422
423
  },
423
424
  });
424
425
  ```
425
426
 
426
- A skipped surface is never parsed, and the conversion carries nothing built from it. The `LayoutDocument` such a read produces lists the skipped surfaces in `skippedSurfaces`, so an absent field there means "not read" rather than "none", and `writePdf` refuses that `LayoutDocument` with `PdfSkippedSurfacesError`. The reported `DocumentTree` keeps its outline as `outline-N` entries inside the `destinations` table: without `outline` those entries are absent (and so are the `destN` entries only the outline minted, below), and without `destinations` the table holds none of the document's destinations, while a read outline's `outline-N` entries stay in it, each without a `destination`. There are no layers or residue tables for a skipped surface, and no structure entries in `definitions` without `structure`; internal link constructs are left out without `destinations` (links to a URI are kept), and the form's `contentControl` constructs are absent without `form`. Skipping the outline also renames internal link anchors: a destination stated as a direct array gets a reader-minted `destN` name, numbered in the order the reader meets them, and the outline is read before any page, so without it the names minted for page links (and the anchors their link constructs carry) are renumbered, while each still names the same target, and the tree's `destinations` table loses the `destN` entries only the outline minted. Two skips change reconstruction itself. Without `structure`, a tagged PDF's headings, table cells and divisions are inferred from geometry exactly as for an untagged file, so they can come out differently than in a full conversion. Without `layers`, nothing marks content as belonging to a hidden layer, so content the default view hides is kept as if it were visible. Those are also the two differences that reach a rebuild: a `DocumentTree` from a conversion without `pages` still carries its `pages` envelope, so `buildDocumentBytes(tree, "pdf")` rebuilds it, and the rebuilt PDF draws hidden-layer text visibly when `layers` was skipped and holds the geometry-inferred blocks when `structure` was skipped. The rebuild never re-emits the outline, destinations, form, layers, structure or residue whether or not a surface was skipped, since it builds the PDF from the tree's metadata, page sizes, embedded fonts and the positioned content alone: text runs, images, vectors, formulas, table-cell background rectangles and border lines, sheet-cell rectangles and border lines, and URI links attached to a recovered run. An external link whose rectangle covers no recovered run (a link over an image, say) stays a link construct in the tree and is not re-emitted. Its `LayoutDocument` never carries `skippedSurfaces`, so `writePdf` never refuses a rebuild.
427
+ A skipped surface is never parsed, and the conversion carries nothing built from it. The `LayoutDocument` such a read produces lists the skipped surfaces in `skippedSurfaces`, so an absent field there means "not read" rather than "none", and `writePdf` refuses that `LayoutDocument` with `PdfSkippedSurfacesError`. The reported `DocumentTree` keeps its outline as `outline-N` entries inside the `destinations` table: without `outline` those entries are absent (and so are the `destN` entries only the outline minted, below), and without `destinations` the table holds none of the document's destinations, while a read outline's `outline-N` entries stay in it, each without a `destination`. There are no layers or residue tables for a skipped surface, and no structure entries in `definitions` without `structure`; internal link constructs are left out without `destinations` (links to a URI are kept), and the form's `contentControl` constructs are absent without `form`. Without `images` no image stream is decoded, so the tree holds no images, which is what keeps a text-only conversion of a page carrying a large raster (a scan, or a drawing exported as one image) within a Worker isolate's memory. Skipping the outline also renames internal link anchors: a destination stated as a direct array gets a reader-minted `destN` name, numbered in the order the reader meets them, and the outline is read before any page, so without it the names minted for page links (and the anchors their link constructs carry) are renumbered, while each still names the same target, and the tree's `destinations` table loses the `destN` entries only the outline minted. Two skips change reconstruction itself. Without `structure`, a tagged PDF's headings, table cells and divisions are inferred from geometry exactly as for an untagged file, so they can come out differently than in a full conversion. Without `layers`, nothing marks content as belonging to a hidden layer, so content the default view hides is kept as if it were visible. Those two, and the images a conversion without `images` never read, are the differences that reach a rebuild: a `DocumentTree` from a conversion without `pages` still carries its `pages` envelope, so `buildDocumentBytes(tree, "pdf")` rebuilds it, and the rebuilt PDF draws hidden-layer text visibly when `layers` was skipped, holds the geometry-inferred blocks when `structure` was skipped, and draws no image when `images` was skipped. The rebuild never re-emits the outline, destinations, form, layers, structure or residue whether or not a surface was skipped, since it builds the PDF from the tree's metadata, page sizes, embedded fonts and the positioned content alone: text runs, images, vectors, formulas, table-cell background rectangles and border lines, sheet-cell rectangles and border lines, and URI links attached to a recovered run. An external link whose rectangle covers no recovered run (a link over an image, say) stays a link construct in the tree and is not re-emitted. Its `LayoutDocument` never carries `skippedSurfaces`, so `writePdf` never refuses a rebuild.
427
428
 
428
- `readDocumentMetadata` always reads a pdf with an empty page selection and every surface skipped, since metadata comes from the trailer's `/Info`, the catalog's `/Lang` and the XMP packet alone, so identifying a document parses neither its pages nor its outline, destinations, form, layers, structure tree or residue, and returns the same metadata a full read does. `openPdf` takes neither option, since an editor holds a whole document to write back. `ReadPdfSurfaces`, `LayoutDocumentSurface` and `PdfSkippedSurfacesError` are exported from the root barrel.
429
+ `readDocumentMetadata` always reads a pdf with an empty page selection and every surface skipped, since metadata comes from the trailer's `/Info`, the catalog's `/Lang` and the XMP packet alone, so identifying a document parses neither its pages nor its outline, destinations, form, layers, structure tree, residue or images, and returns the same metadata a full read does. `openPdf` takes neither option, since an editor holds a whole document to write back. `ReadPdfSurfaces`, `LayoutDocumentSurface` and `PdfSkippedSurfacesError` are exported from the root barrel.
429
430
 
430
431
  ### Reading and building xlsx content directly
431
432
 
@@ -41,7 +41,7 @@ interface UnifiedConversionOptions {
41
41
  */
42
42
  readonly pages?: readonly number[];
43
43
  /**
44
- * The document-level surfaces of a pdf source to read, as pdf-codec's `ReadPdfOptions.surfaces` takes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`), each read unless set to `false`, so omitting it reads everything as before. Independent of `pages`, and handed to the same hop: only the plan's first hop, and only when the conversion's source is pdf, so an intermediate pdf a route renders internally is always read whole. A skipped surface is never parsed and is absent from the read, so what the conversion builds from it is absent too: no `outline-N` entries in the tree's `destinations` table without `outline`, no destinations and no internal link constructs without `destinations` (a link to a URI is kept, and a read outline's `outline-N` entries stay, each without a `destination`), no form `contentControl` constructs without `form`, no layers table without `layers`, no structure entries in `definitions` without `structure`, no residue without `residue`; skipping the outline also renumbers the reader-minted `destN` names internal link anchors carry, since the outline mints its direct destinations first. Two skips also change reconstruction: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides cannot be told apart and is kept as if visible. See `ReadPdfOptions.surfaces` for exactly what each covers.
44
+ * The document-level surfaces of a pdf source to read, as pdf-codec's `ReadPdfOptions.surfaces` takes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`, `images`), each read unless set to `false`, so omitting it reads everything as before. Independent of `pages`, and handed to the same hop: only the plan's first hop, and only when the conversion's source is pdf, so an intermediate pdf a route renders internally is always read whole. A skipped surface is never parsed and is absent from the read, so what the conversion builds from it is absent too: no `outline-N` entries in the tree's `destinations` table without `outline`, no destinations and no internal link constructs without `destinations` (a link to a URI is kept, and a read outline's `outline-N` entries stay, each without a `destination`), no form `contentControl` constructs without `form`, no layers table without `layers`, no structure entries in `definitions` without `structure`, no residue without `residue`, no images without `images` (no image stream is decoded, so a text-only conversion of an image-heavy page costs no image memory); skipping the outline also renumbers the reader-minted `destN` names internal link anchors carry, since the outline mints its direct destinations first. Two skips also change reconstruction: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides cannot be told apart and is kept as if visible. See `ReadPdfOptions.surfaces` for exactly what each covers.
45
45
  */
46
46
  readonly surfaces?: ReadPdfSurfaces;
47
47
  }
@@ -41,7 +41,7 @@ interface UnifiedConversionOptions {
41
41
  */
42
42
  readonly pages?: readonly number[];
43
43
  /**
44
- * The document-level surfaces of a pdf source to read, as pdf-codec's `ReadPdfOptions.surfaces` takes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`), each read unless set to `false`, so omitting it reads everything as before. Independent of `pages`, and handed to the same hop: only the plan's first hop, and only when the conversion's source is pdf, so an intermediate pdf a route renders internally is always read whole. A skipped surface is never parsed and is absent from the read, so what the conversion builds from it is absent too: no `outline-N` entries in the tree's `destinations` table without `outline`, no destinations and no internal link constructs without `destinations` (a link to a URI is kept, and a read outline's `outline-N` entries stay, each without a `destination`), no form `contentControl` constructs without `form`, no layers table without `layers`, no structure entries in `definitions` without `structure`, no residue without `residue`; skipping the outline also renumbers the reader-minted `destN` names internal link anchors carry, since the outline mints its direct destinations first. Two skips also change reconstruction: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides cannot be told apart and is kept as if visible. See `ReadPdfOptions.surfaces` for exactly what each covers.
44
+ * The document-level surfaces of a pdf source to read, as pdf-codec's `ReadPdfOptions.surfaces` takes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`, `images`), each read unless set to `false`, so omitting it reads everything as before. Independent of `pages`, and handed to the same hop: only the plan's first hop, and only when the conversion's source is pdf, so an intermediate pdf a route renders internally is always read whole. A skipped surface is never parsed and is absent from the read, so what the conversion builds from it is absent too: no `outline-N` entries in the tree's `destinations` table without `outline`, no destinations and no internal link constructs without `destinations` (a link to a URI is kept, and a read outline's `outline-N` entries stay, each without a `destination`), no form `contentControl` constructs without `form`, no layers table without `layers`, no structure entries in `definitions` without `structure`, no residue without `residue`, no images without `images` (no image stream is decoded, so a text-only conversion of an image-heavy page costs no image memory); skipping the outline also renumbers the reader-minted `destN` names internal link anchors carry, since the outline mints its direct destinations first. Two skips also change reconstruction: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides cannot be told apart and is kept as if visible. See `ReadPdfOptions.surfaces` for exactly what each covers.
45
45
  */
46
46
  readonly surfaces?: ReadPdfSurfaces;
47
47
  }
@@ -1,2 +1,2 @@
1
- import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-D7mR0HWB.cjs";
1
+ import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-8R2Kc2mU.cjs";
2
2
  export { CompositionHop, ConversionPlan, GraphEdge, HopExecutor, buildCompositionGraph, isContentFormat, isSourceContentFormat, resolveCompositionPlan, shortestPath };
@@ -1,2 +1,2 @@
1
- import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-DPZq6NhK.js";
1
+ import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-CMFkLUcl.js";
2
2
  export { CompositionHop, ConversionPlan, GraphEdge, HopExecutor, buildCompositionGraph, isContentFormat, isSourceContentFormat, resolveCompositionPlan, shortestPath };
@@ -1,5 +1,5 @@
1
1
  import { DocumentFormat } from "./port.cjs";
2
- import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-D7mR0HWB.cjs";
2
+ import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-8R2Kc2mU.cjs";
3
3
  //#region src/convert/composition-to-pdf.d.ts
4
4
  declare function executeToPdf(format: SourceContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
5
5
  declare function convertDocument(source: DocumentFormat, target: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
@@ -1,5 +1,5 @@
1
1
  import { DocumentFormat } from "./port.js";
2
- import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-DPZq6NhK.js";
2
+ import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-CMFkLUcl.js";
3
3
  //#region src/convert/composition-to-pdf.d.ts
4
4
  declare function executeToPdf(format: SourceContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
5
5
  declare function convertDocument(source: DocumentFormat, target: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
@@ -1,2 +1,2 @@
1
- import { A as isTextFormatNode, C as THROUGH_PDF_EDGE_COST, D as executeBridge, E as convertDocumentFromPdf, O as executeFromPdf, S as SourceContentFormat, T as UnifiedConversionOptions, _ as READ_ONLY_CONTENT_FORMATS, b as ReadOnlyContentFormat, d as CompositionExecutorBinding, f as ContentFormat, g as MAX_CONVERSION_PATH_NODES, h as LAYOUT_CAPABLE, j as runCompositionPlan, k as isReadOnlyContentFormat, m as FormatNode, p as FORMAT_NODES, u as CONTENT_FORMATS, v as READ_ONLY_FORMAT_NODES, w as TRANSFORMS, x as ReadOnlyFormatNode, y as RECONSTRUCTORS } from "../composition-plan-D7mR0HWB.cjs";
1
+ import { A as isTextFormatNode, C as THROUGH_PDF_EDGE_COST, D as executeBridge, E as convertDocumentFromPdf, O as executeFromPdf, S as SourceContentFormat, T as UnifiedConversionOptions, _ as READ_ONLY_CONTENT_FORMATS, b as ReadOnlyContentFormat, d as CompositionExecutorBinding, f as ContentFormat, g as MAX_CONVERSION_PATH_NODES, h as LAYOUT_CAPABLE, j as runCompositionPlan, k as isReadOnlyContentFormat, m as FormatNode, p as FORMAT_NODES, u as CONTENT_FORMATS, v as READ_ONLY_FORMAT_NODES, w as TRANSFORMS, x as ReadOnlyFormatNode, y as RECONSTRUCTORS } from "../composition-plan-8R2Kc2mU.cjs";
2
2
  export { CONTENT_FORMATS, CompositionExecutorBinding, ContentFormat, FORMAT_NODES, FormatNode, LAYOUT_CAPABLE, MAX_CONVERSION_PATH_NODES, READ_ONLY_CONTENT_FORMATS, READ_ONLY_FORMAT_NODES, RECONSTRUCTORS, ReadOnlyContentFormat, ReadOnlyFormatNode, SourceContentFormat, THROUGH_PDF_EDGE_COST, TRANSFORMS, UnifiedConversionOptions, convertDocumentFromPdf, executeBridge, executeFromPdf, isReadOnlyContentFormat, isTextFormatNode, runCompositionPlan };
@@ -1,2 +1,2 @@
1
- import { A as isTextFormatNode, C as THROUGH_PDF_EDGE_COST, D as executeBridge, E as convertDocumentFromPdf, O as executeFromPdf, S as SourceContentFormat, T as UnifiedConversionOptions, _ as READ_ONLY_CONTENT_FORMATS, b as ReadOnlyContentFormat, d as CompositionExecutorBinding, f as ContentFormat, g as MAX_CONVERSION_PATH_NODES, h as LAYOUT_CAPABLE, j as runCompositionPlan, k as isReadOnlyContentFormat, m as FormatNode, p as FORMAT_NODES, u as CONTENT_FORMATS, v as READ_ONLY_FORMAT_NODES, w as TRANSFORMS, x as ReadOnlyFormatNode, y as RECONSTRUCTORS } from "../composition-plan-DPZq6NhK.js";
1
+ import { A as isTextFormatNode, C as THROUGH_PDF_EDGE_COST, D as executeBridge, E as convertDocumentFromPdf, O as executeFromPdf, S as SourceContentFormat, T as UnifiedConversionOptions, _ as READ_ONLY_CONTENT_FORMATS, b as ReadOnlyContentFormat, d as CompositionExecutorBinding, f as ContentFormat, g as MAX_CONVERSION_PATH_NODES, h as LAYOUT_CAPABLE, j as runCompositionPlan, k as isReadOnlyContentFormat, m as FormatNode, p as FORMAT_NODES, u as CONTENT_FORMATS, v as READ_ONLY_FORMAT_NODES, w as TRANSFORMS, x as ReadOnlyFormatNode, y as RECONSTRUCTORS } from "../composition-plan-CMFkLUcl.js";
2
2
  export { CONTENT_FORMATS, CompositionExecutorBinding, ContentFormat, FORMAT_NODES, FormatNode, LAYOUT_CAPABLE, MAX_CONVERSION_PATH_NODES, READ_ONLY_CONTENT_FORMATS, READ_ONLY_FORMAT_NODES, RECONSTRUCTORS, ReadOnlyContentFormat, ReadOnlyFormatNode, SourceContentFormat, THROUGH_PDF_EDGE_COST, TRANSFORMS, UnifiedConversionOptions, convertDocumentFromPdf, executeBridge, executeFromPdf, isReadOnlyContentFormat, isTextFormatNode, runCompositionPlan };
@@ -12,7 +12,8 @@ const METADATA_SURFACES = {
12
12
  form: false,
13
13
  layers: false,
14
14
  structure: false,
15
- residue: false
15
+ residue: false,
16
+ images: false
16
17
  };
17
18
  function readDocumentMetadata(format, bytes, options) {
18
19
  if (format === "pdf") return (0, pdf_codec_read.readPdf)(bytes, {
@@ -18,7 +18,7 @@ interface ReadNativeDocumentTreeOptions {
18
18
  */
19
19
  readonly pages?: readonly number[];
20
20
  /**
21
- * The document-level surfaces of a pdf source to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface, each read unless set to `false`, independent of `pages`. Consulted only for a pdf source. A skipped surface is absent from the read, so the tree carries nothing built from it (see UnifiedConversionOptions.surfaces for exactly what: `outline-N` entries in `destinations`, destinations and internal link constructs, form `contentControl` constructs, the layers table, structure entries in `definitions`, residue), and reconstruction loses what it took from it: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry, and without `layers` hidden-layer content is kept as if visible.
21
+ * The document-level surfaces of a pdf source to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface, each read unless set to `false`, independent of `pages`. Consulted only for a pdf source. A skipped surface is absent from the read, so the tree carries nothing built from it (see UnifiedConversionOptions.surfaces for exactly what: `outline-N` entries in `destinations`, destinations and internal link constructs, form `contentControl` constructs, the layers table, structure entries in `definitions`, residue, images), and reconstruction loses what it took from it: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry, and without `layers` hidden-layer content is kept as if visible.
22
22
  */
23
23
  readonly surfaces?: ReadPdfSurfaces;
24
24
  }
@@ -35,7 +35,7 @@ interface PdfToDocumentOptions {
35
35
  */
36
36
  readonly pages?: readonly number[];
37
37
  /**
38
- * The document-level surfaces to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`), each read unless set to `false`, independent of `pages`. A skipped surface is never parsed, and the conversion carries nothing built from it. Without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides is kept as if visible.
38
+ * The document-level surfaces to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`, `images`), each read unless set to `false`, independent of `pages`. A skipped surface is never parsed, and the conversion carries nothing built from it. Without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides is kept as if visible.
39
39
  */
40
40
  readonly surfaces?: ReadPdfSurfaces;
41
41
  readonly onDocument?: (pkg: DocumentTree) => void;
@@ -18,7 +18,7 @@ interface ReadNativeDocumentTreeOptions {
18
18
  */
19
19
  readonly pages?: readonly number[];
20
20
  /**
21
- * The document-level surfaces of a pdf source to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface, each read unless set to `false`, independent of `pages`. Consulted only for a pdf source. A skipped surface is absent from the read, so the tree carries nothing built from it (see UnifiedConversionOptions.surfaces for exactly what: `outline-N` entries in `destinations`, destinations and internal link constructs, form `contentControl` constructs, the layers table, structure entries in `definitions`, residue), and reconstruction loses what it took from it: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry, and without `layers` hidden-layer content is kept as if visible.
21
+ * The document-level surfaces of a pdf source to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface, each read unless set to `false`, independent of `pages`. Consulted only for a pdf source. A skipped surface is absent from the read, so the tree carries nothing built from it (see UnifiedConversionOptions.surfaces for exactly what: `outline-N` entries in `destinations`, destinations and internal link constructs, form `contentControl` constructs, the layers table, structure entries in `definitions`, residue, images), and reconstruction loses what it took from it: without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry, and without `layers` hidden-layer content is kept as if visible.
22
22
  */
23
23
  readonly surfaces?: ReadPdfSurfaces;
24
24
  }
@@ -35,7 +35,7 @@ interface PdfToDocumentOptions {
35
35
  */
36
36
  readonly pages?: readonly number[];
37
37
  /**
38
- * The document-level surfaces to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`), each read unless set to `false`, independent of `pages`. A skipped surface is never parsed, and the conversion carries nothing built from it. Without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides is kept as if visible.
38
+ * The document-level surfaces to read, exactly as UnifiedConversionOptions.surfaces describes them: one boolean per surface (`outline`, `destinations`, `form`, `layers`, `structure`, `residue`, `images`), each read unless set to `false`, independent of `pages`. A skipped surface is never parsed, and the conversion carries nothing built from it. Without `structure` a tagged PDF's headings, table cells and divisions are inferred from geometry as for an untagged file, and without `layers` content the default view hides is kept as if visible.
39
39
  */
40
40
  readonly surfaces?: ReadPdfSurfaces;
41
41
  readonly onDocument?: (pkg: DocumentTree) => void;
@@ -11,7 +11,8 @@ const METADATA_SURFACES = {
11
11
  form: false,
12
12
  layers: false,
13
13
  structure: false,
14
- residue: false
14
+ residue: false,
15
+ images: false
15
16
  };
16
17
  function readDocumentMetadata(format, bytes, options) {
17
18
  if (format === "pdf") return readPdf(bytes, {
package/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ import { a as CellTypeRule, i as CellTypeInferenceSink, n as CellTypeInference,
6
6
  import { a as ReconstructOptions, f as reconstructSpreadsheet, p as reconstructWordprocessing } from "./reconstruct-D4TEteZ6.cjs";
7
7
  import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-uwYyRetr.cjs";
8
8
  import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-c0Lp3_iY.cjs";
9
- import { T as UnifiedConversionOptions, c as resolveCompositionPlan, n as ConversionPlan, t as CompositionHop } from "./composition-plan-D7mR0HWB.cjs";
9
+ import { T as UnifiedConversionOptions, c as resolveCompositionPlan, n as ConversionPlan, t as CompositionHop } from "./composition-plan-8R2Kc2mU.cjs";
10
10
  import { convertDocument } from "./convert/composition-to-pdf.cjs";
11
11
  import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat-Cl2exlEh.cjs";
12
12
  import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-ChR2F9dJ.cjs";
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import { a as CellTypeRule, i as CellTypeInferenceSink, n as CellTypeInference,
6
6
  import { a as ReconstructOptions, f as reconstructSpreadsheet, p as reconstructWordprocessing } from "./reconstruct-BKOCAedo.js";
7
7
  import { i as mapMathVariant, n as applyMathVariant, r as isMathVariant, t as MathVariant } from "./variant-uwYyRetr.js";
8
8
  import { n as OmmlDiagnosticKind, t as OmmlDiagnostic } from "./shared-DHu5jDJf.js";
9
- import { T as UnifiedConversionOptions, c as resolveCompositionPlan, n as ConversionPlan, t as CompositionHop } from "./composition-plan-DPZq6NhK.js";
9
+ import { T as UnifiedConversionOptions, c as resolveCompositionPlan, n as ConversionPlan, t as CompositionHop } from "./composition-plan-CMFkLUcl.js";
10
10
  import { convertDocument } from "./convert/composition-to-pdf.js";
11
11
  import { n as HsqldbDecodeOptions, r as HsqldbRowFormatError } from "./rowformat-Cl2exlEh.js";
12
12
  import { i as extractSourceFonts, n as FontSourcePackage, r as createDocumentFontRegistry, t as DocumentFontRegistryOptions } from "./registry-BrXpPnGF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "14.6.1",
3
+ "version": "14.6.3",
4
4
  "description": "Converts between docx, pptx, odt, odp, ods, odg, xlsx, csv, svg, markdown, rtf, doc, xls, ppt and PDF through one shared, Zod-typed content schema (wpd read-only), plus read+write editors for OOXML and OpenDocument. Worker-isomorphic.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -77,21 +77,21 @@
77
77
  ],
78
78
  "license": "MIT",
79
79
  "dependencies": {
80
- "archive-codec": "1.11.26",
80
+ "archive-codec": "1.11.27",
81
81
  "byte-codec": "2.0.2",
82
- "doc-codec": "6.1.23",
83
- "document-schema.js": "7.16.1",
84
- "epub-codec": "5.1.16",
82
+ "doc-codec": "6.1.24",
83
+ "document-schema.js": "7.16.2",
84
+ "epub-codec": "5.1.17",
85
85
  "fflate": "0.8.3",
86
- "markdown-codec": "11.1.16",
87
- "odf.js": "11.2.2",
88
- "ooxml.js": "12.2.32",
89
- "pdf-codec": "5.5.0",
90
- "ppt-codec": "2.2.23",
91
- "rtf-codec": "8.1.24",
86
+ "markdown-codec": "11.1.17",
87
+ "odf.js": "11.2.3",
88
+ "ooxml.js": "12.2.33",
89
+ "pdf-codec": "5.6.0",
90
+ "ppt-codec": "2.2.24",
91
+ "rtf-codec": "8.1.25",
92
92
  "temml": "0.13.4",
93
- "wpd-codec": "5.1.22",
94
- "xls-codec": "4.16.5",
93
+ "wpd-codec": "5.1.23",
94
+ "xls-codec": "4.16.6",
95
95
  "zod": "4.4.3"
96
96
  },
97
97
  "devDependencies": {