@laminapdf/sdk 0.2.0-alpha.3 → 0.2.0-alpha.4
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 +21 -1
- package/dist/api.d.ts +4 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -0
- package/dist/api.js.map +1 -1
- package/dist/builder.d.ts +8 -3
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +8 -3
- package/dist/builder.js.map +1 -1
- package/dist/document.d.ts +42 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +65 -0
- package/dist/document.js.map +1 -1
- package/dist/extract-job.d.ts +100 -0
- package/dist/extract-job.d.ts.map +1 -0
- package/dist/extract-job.js +177 -0
- package/dist/extract-job.js.map +1 -0
- package/dist/extract.d.ts +1 -1
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js.map +1 -1
- package/dist/generated/builder-enums.d.ts +3 -3
- package/dist/generated/builder-enums.d.ts.map +1 -1
- package/dist/generated/builder-enums.js +10 -0
- package/dist/generated/builder-enums.js.map +1 -1
- package/dist/generated/codes.d.ts +2 -2
- package/dist/generated/codes.d.ts.map +1 -1
- package/dist/generated/codes.js +55 -1
- package/dist/generated/codes.js.map +1 -1
- package/dist/generated/explain.d.ts.map +1 -1
- package/dist/generated/explain.js +19 -2
- package/dist/generated/explain.js.map +1 -1
- package/dist/generated/extract.d.ts +50 -3
- package/dist/generated/extract.d.ts.map +1 -1
- package/dist/source/http.d.ts +1 -1
- package/dist/source/http.js +1 -1
- package/dist/types.d.ts +19 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/support.d.ts +7 -1
- package/dist/worker/support.d.ts.map +1 -1
- package/dist/worker/support.js +4 -0
- package/dist/worker/support.js.map +1 -1
- package/docs/AGENTS.md +1 -1
- package/docs/api/README.md +20 -1
- package/docs/api/classes/Builder.md +1 -1
- package/docs/api/classes/Document.md +113 -1
- package/docs/api/classes/ExtractJob.md +236 -0
- package/docs/api/classes/Font.md +1 -1
- package/docs/api/classes/Image.md +1 -1
- package/docs/api/classes/LaminaPdfError.md +1 -1
- package/docs/api/classes/Page.md +1 -1
- package/docs/api/classes/PageRef.md +1 -1
- package/docs/api/classes/PageText.md +1 -1
- package/docs/api/classes/PageTextRun.md +1 -1
- package/docs/api/classes/PendingPath.md +1 -1
- package/docs/api/classes/SaveJob.md +1 -1
- package/docs/api/classes/Surface.md +10 -5
- package/docs/api/classes/Transaction.md +1 -1
- package/docs/api/functions/callbackSource.md +1 -1
- package/docs/api/functions/extractWithModels.md +70 -0
- package/docs/api/functions/httpRangeSource.md +2 -2
- package/docs/api/functions/init.md +1 -1
- package/docs/api/functions/isExtractLoaded.md +1 -1
- package/docs/api/functions/isInitialized.md +1 -1
- package/docs/api/functions/isLaminaPdfError.md +1 -1
- package/docs/api/functions/isTextLoaded.md +1 -1
- package/docs/api/functions/loadExtract.md +1 -1
- package/docs/api/functions/loadText.md +1 -1
- package/docs/api/functions/onLeak.md +1 -1
- package/docs/api/functions/reset.md +1 -1
- package/docs/api/functions/wasmMemory.md +1 -1
- package/docs/api/interfaces/BuilderOptions.md +1 -1
- package/docs/api/interfaces/ByteRange.md +1 -1
- package/docs/api/interfaces/ChunkOptions.md +1 -1
- package/docs/api/interfaces/Diagnostic.md +1 -1
- package/docs/api/interfaces/ExtractOptions.md +1 -1
- package/docs/api/interfaces/ExtractResult.md +1 -1
- package/docs/api/interfaces/FontInfo.md +1 -1
- package/docs/api/interfaces/HostModels.md +57 -0
- package/docs/api/interfaces/HttpRangeOptions.md +1 -1
- package/docs/api/interfaces/InitOptions.md +1 -1
- package/docs/api/interfaces/LayoutRegion.md +38 -0
- package/docs/api/interfaces/Leak.md +1 -1
- package/docs/api/interfaces/Location.md +1 -1
- package/docs/api/interfaces/ModelInfo.md +45 -0
- package/docs/api/interfaces/ModelRequest.md +45 -0
- package/docs/api/interfaces/Models.md +45 -0
- package/docs/api/interfaces/OcrWord.md +37 -0
- package/docs/api/interfaces/OpLog.md +1 -1
- package/docs/api/interfaces/OpenOptions.md +1 -1
- package/docs/api/interfaces/PageTextOptions.md +1 -1
- package/docs/api/interfaces/PathBuilder.md +1 -1
- package/docs/api/interfaces/QuadPoint.md +1 -1
- package/docs/api/interfaces/RangeOptions.md +1 -1
- package/docs/api/interfaces/RangeSource.md +1 -1
- package/docs/api/interfaces/StrokeStyle.md +1 -1
- package/docs/api/interfaces/TagSpec.md +3 -3
- package/docs/api/interfaces/TextBoxOptions.md +1 -1
- package/docs/api/interfaces/TextGlyph.md +1 -1
- package/docs/api/interfaces/TextOptions.md +1 -1
- package/docs/api/interfaces/WasmMemory.md +1 -1
- package/docs/api/type-aliases/AfRelationship.md +1 -1
- package/docs/api/type-aliases/Align.md +1 -1
- package/docs/api/type-aliases/ArtifactKind.md +2 -2
- package/docs/api/type-aliases/AttachmentOptions.md +1 -1
- package/docs/api/type-aliases/BlendMode.md +1 -1
- package/docs/api/type-aliases/BoxRect.md +1 -1
- package/docs/api/type-aliases/BuildOptions.md +1 -1
- package/docs/api/type-aliases/Cell.md +1 -1
- package/docs/api/type-aliases/Chunk.md +1 -1
- package/docs/api/type-aliases/Color.md +1 -1
- package/docs/api/type-aliases/Coordinates.md +1 -1
- package/docs/api/type-aliases/Direction.md +1 -1
- package/docs/api/type-aliases/DocumentInfo.md +1 -1
- package/docs/api/type-aliases/DropReason.md +2 -2
- package/docs/api/type-aliases/Dropped.md +1 -1
- package/docs/api/type-aliases/Edited.md +1 -1
- package/docs/api/type-aliases/ErrorCode.md +2 -2
- package/docs/api/type-aliases/ErrorKind.md +1 -1
- package/docs/api/type-aliases/ExtractFormat.md +1 -1
- package/docs/api/type-aliases/ExtractJobOptions.md +31 -0
- package/docs/api/type-aliases/ExtractStep.md +61 -0
- package/docs/api/type-aliases/ExtractedBlock.md +13 -1
- package/docs/api/type-aliases/ExtractedPage.md +9 -1
- package/docs/api/type-aliases/ExtractedSource.md +1 -1
- package/docs/api/type-aliases/Extraction.md +1 -1
- package/docs/api/type-aliases/FillRule.md +1 -1
- package/docs/api/type-aliases/Fit.md +1 -1
- package/docs/api/type-aliases/Flags.md +1 -1
- package/docs/api/type-aliases/Generator.md +5 -3
- package/docs/api/type-aliases/GlyphQuad.md +1 -1
- package/docs/api/type-aliases/InfoPatch.md +1 -1
- package/docs/api/type-aliases/LaminaPdfWarning.md +1 -1
- package/docs/api/type-aliases/LimitName.md +1 -1
- package/docs/api/type-aliases/Limits.md +1 -1
- package/docs/api/type-aliases/LineBox.md +1 -1
- package/docs/api/type-aliases/LineCap.md +1 -1
- package/docs/api/type-aliases/LineJoin.md +1 -1
- package/docs/api/type-aliases/LinkTarget.md +1 -1
- package/docs/api/type-aliases/Metadata.md +1 -1
- package/docs/api/type-aliases/ModelResult.md +15 -0
- package/docs/api/type-aliases/Op.md +1 -1
- package/docs/api/type-aliases/OutlineEntry.md +1 -1
- package/docs/api/type-aliases/OutlineNode.md +15 -0
- package/docs/api/type-aliases/Overflow.md +1 -1
- package/docs/api/type-aliases/PageInfo.md +1 -1
- package/docs/api/type-aliases/PageLabel.md +1 -1
- package/docs/api/type-aliases/PageSizeName.md +1 -1
- package/docs/api/type-aliases/Point.md +1 -1
- package/docs/api/type-aliases/Profile.md +1 -1
- package/docs/api/type-aliases/Progress.md +1 -1
- package/docs/api/type-aliases/ReadingOrder.md +1 -1
- package/docs/api/type-aliases/Rect.md +1 -1
- package/docs/api/type-aliases/Region.md +1 -1
- package/docs/api/type-aliases/RegionLabel.md +15 -0
- package/docs/api/type-aliases/RenderMode.md +1 -1
- package/docs/api/type-aliases/Rotation.md +1 -1
- package/docs/api/type-aliases/SaveOptions.md +1 -1
- package/docs/api/type-aliases/SaveReport.md +1 -1
- package/docs/api/type-aliases/Span.md +12 -1
- package/docs/api/type-aliases/SplitOn.md +1 -1
- package/docs/api/type-aliases/Standard14.md +1 -1
- package/docs/api/type-aliases/StructRef.md +1 -1
- package/docs/api/type-aliases/StructSource.md +1 -1
- package/docs/api/type-aliases/StructureKid.md +15 -0
- package/docs/api/type-aliases/StructureNode.md +16 -0
- package/docs/api/type-aliases/TableDetector.md +1 -1
- package/docs/api/type-aliases/TableMode.md +1 -1
- package/docs/api/type-aliases/TableScope.md +1 -1
- package/docs/api/type-aliases/Tag.md +1 -1
- package/docs/api/type-aliases/TagName.md +1 -1
- package/docs/api/type-aliases/Target.md +15 -0
- package/docs/api/type-aliases/TargetView.md +18 -0
- package/docs/api/type-aliases/TextLayer.md +72 -0
- package/docs/api/type-aliases/TextLayerStatus.md +15 -0
- package/docs/api/type-aliases/TextLayout.md +1 -1
- package/docs/api/type-aliases/TextRange.md +1 -1
- package/docs/api/type-aliases/TextRunInfo.md +1 -1
- package/docs/api/type-aliases/Transform.md +1 -1
- package/docs/api/type-aliases/UndoOutcome.md +1 -1
- package/docs/api/type-aliases/ViewerPreferences.md +1 -1
- package/docs/api/type-aliases/WarningCode.md +2 -2
- package/docs/api/type-aliases/WasmSource.md +1 -1
- package/docs/api/variables/Matrix.md +1 -1
- package/docs/api/variables/PAGE_SIZES.md +1 -1
- package/docs/api/variables/TAG_NAMES.md +2 -2
- package/docs/errors/README.md +18 -1
- package/docs/errors/aes-padding-invalid.md +1 -1
- package/docs/errors/already-initialized.md +1 -1
- package/docs/errors/binary-output-to-terminal.md +1 -1
- package/docs/errors/builder-finished.md +1 -1
- package/docs/errors/cancelled.md +1 -1
- package/docs/errors/cmap-invalid.md +1 -1
- package/docs/errors/collection-index.md +1 -1
- package/docs/errors/color-components.md +1 -1
- package/docs/errors/content-bad-operands.md +1 -1
- package/docs/errors/content-path-unpainted.md +1 -1
- package/docs/errors/content-resource-missing.md +1 -1
- package/docs/errors/content-syntax.md +1 -1
- package/docs/errors/content-unbalanced-bt.md +1 -1
- package/docs/errors/content-unbalanced-marked.md +1 -1
- package/docs/errors/content-unbalanced-q.md +1 -1
- package/docs/errors/content-unknown-operator.md +1 -1
- package/docs/errors/covered-text.md +33 -0
- package/docs/errors/data-pending.md +1 -1
- package/docs/errors/decompress.md +1 -1
- package/docs/errors/device-color-without-output-intent.md +1 -1
- package/docs/errors/direct-page.md +1 -1
- package/docs/errors/disposed.md +1 -1
- package/docs/errors/document-changed.md +1 -1
- package/docs/errors/embedded-file-forbidden.md +1 -1
- package/docs/errors/embedded-file-without-mime-type.md +1 -1
- package/docs/errors/encoding-full.md +1 -1
- package/docs/errors/encrypted-base.md +1 -1
- package/docs/errors/extract-column-order-uncertain.md +38 -0
- package/docs/errors/extract-limit-blocks.md +1 -1
- package/docs/errors/extract-module-not-loaded.md +1 -1
- package/docs/errors/extract-needs-ocr.md +37 -0
- package/docs/errors/extract-reading-order-ambiguous.md +1 -1
- package/docs/errors/extract-struct-tree-ignored.md +1 -1
- package/docs/errors/extract-table-ambiguous.md +1 -1
- package/docs/errors/extract-table-limit.md +1 -1
- package/docs/errors/extract-untagged-content.md +1 -1
- package/docs/errors/fetch-failed.md +3 -3
- package/docs/errors/flate-truncated.md +1 -1
- package/docs/errors/flow-content-too-large.md +34 -0
- package/docs/errors/flow-keep-broken.md +34 -0
- package/docs/errors/flow-layout-unstable.md +38 -0
- package/docs/errors/font-invalid.md +1 -1
- package/docs/errors/font-mismatch.md +1 -1
- package/docs/errors/font-not-embeddable.md +1 -1
- package/docs/errors/font-not-embedded.md +1 -1
- package/docs/errors/font-not-shapable.md +1 -1
- package/docs/errors/glyph-out-of-range.md +1 -1
- package/docs/errors/glyph-without-unicode.md +7 -5
- package/docs/errors/heading-level-skipped.md +1 -1
- package/docs/errors/image-data-length.md +1 -1
- package/docs/errors/image-too-large.md +1 -1
- package/docs/errors/inline-image-unterminated.md +1 -1
- package/docs/errors/input-unreadable.md +1 -1
- package/docs/errors/instance-reset.md +1 -1
- package/docs/errors/invalid-argument.md +1 -1
- package/docs/errors/invalid-axis-value.md +1 -1
- package/docs/errors/invalid-box.md +1 -1
- package/docs/errors/invalid-color.md +1 -1
- package/docs/errors/invalid-command-line.md +1 -1
- package/docs/errors/invalid-date.md +1 -1
- package/docs/errors/invalid-entry.md +1 -1
- package/docs/errors/invalid-feature.md +1 -1
- package/docs/errors/invalid-font.md +1 -1
- package/docs/errors/invalid-geometry.md +1 -1
- package/docs/errors/invalid-icc-profile.md +1 -1
- package/docs/errors/invalid-image.md +1 -1
- package/docs/errors/invalid-op-log.md +1 -1
- package/docs/errors/invalid-page-label.md +1 -1
- package/docs/errors/invalid-page-labels.md +1 -1
- package/docs/errors/invalid-page-range.md +1 -1
- package/docs/errors/invalid-rotate.md +1 -1
- package/docs/errors/invalid-spans.md +39 -0
- package/docs/errors/invalid-structure-nesting.md +1 -1
- package/docs/errors/invalid-structure.md +1 -1
- package/docs/errors/invalid-text-range.md +1 -1
- package/docs/errors/job-finished.md +1 -1
- package/docs/errors/limit-exceeded.md +1 -1
- package/docs/errors/link-without-contents.md +1 -1
- package/docs/errors/link-without-structure.md +1 -1
- package/docs/errors/markdown-html-ignored.md +33 -0
- package/docs/errors/markdown-image-missing.md +34 -0
- package/docs/errors/missing-alt-text.md +1 -1
- package/docs/errors/missing-glyph.md +1 -1
- package/docs/errors/missing-header.md +1 -1
- package/docs/errors/missing-lang.md +1 -1
- package/docs/errors/missing-root.md +1 -1
- package/docs/errors/missing-title.md +1 -1
- package/docs/errors/model-failed.md +33 -0
- package/docs/errors/model-needs-host.md +40 -0
- package/docs/errors/model-result-unexpected.md +36 -0
- package/docs/errors/name-tree-node-skipped.md +1 -1
- package/docs/errors/nested-transaction.md +1 -1
- package/docs/errors/no-pending-save.md +1 -1
- package/docs/errors/no-transaction.md +1 -1
- package/docs/errors/not-initialized.md +1 -1
- package/docs/errors/not-pdf.md +1 -1
- package/docs/errors/not-rebased.md +1 -1
- package/docs/errors/object-number-out-of-range.md +1 -1
- package/docs/errors/objstm-index-mismatch.md +1 -1
- package/docs/errors/out-of-memory.md +1 -1
- package/docs/errors/outline-cycle.md +1 -1
- package/docs/errors/outline-item-skipped.md +1 -1
- package/docs/errors/output-unwritable.md +1 -1
- package/docs/errors/overwrite-refused.md +1 -1
- package/docs/errors/page-count-mismatch.md +1 -1
- package/docs/errors/page-index-out-of-range.md +1 -1
- package/docs/errors/page-tree-node-skipped.md +1 -1
- package/docs/errors/password-required.md +1 -1
- package/docs/errors/path-outside-roots.md +1 -1
- package/docs/errors/perms-mismatch.md +1 -1
- package/docs/errors/profile-version-conflict.md +1 -1
- package/docs/errors/redaction-not-applied.md +32 -0
- package/docs/errors/reference-cycle.md +1 -1
- package/docs/errors/render-backend-unavailable.md +1 -1
- package/docs/errors/render-failed.md +1 -1
- package/docs/errors/render-too-large.md +1 -1
- package/docs/errors/repaired-base.md +1 -1
- package/docs/errors/requires-rewrite.md +1 -1
- package/docs/errors/revision-index-out-of-range.md +34 -0
- package/docs/errors/saved-not-rebased.md +1 -1
- package/docs/errors/sink-not-empty.md +1 -1
- package/docs/errors/sink.md +1 -1
- package/docs/errors/source-budget-exceeded.md +1 -1
- package/docs/errors/source-changed.md +1 -1
- package/docs/errors/source.md +1 -1
- package/docs/errors/stale-generation.md +1 -1
- package/docs/errors/stream-length-recovered.md +1 -1
- package/docs/errors/strict.md +1 -1
- package/docs/errors/subset-failed.md +1 -1
- package/docs/errors/syntax.md +1 -1
- package/docs/errors/tag-element-not-open.md +41 -0
- package/docs/errors/tag-element-unclosed.md +34 -0
- package/docs/errors/text-in-earlier-revision.md +36 -0
- package/docs/errors/text-module-not-loaded.md +1 -1
- package/docs/errors/text-overflow.md +1 -1
- package/docs/errors/tounicode-conflict.md +1 -1
- package/docs/errors/type.md +1 -1
- package/docs/errors/unexpected-eof.md +1 -1
- package/docs/errors/unknown-axis.md +1 -1
- package/docs/errors/unknown-code.md +1 -1
- package/docs/errors/unknown-destination.md +1 -1
- package/docs/errors/unknown-font.md +1 -1
- package/docs/errors/unknown-option.md +1 -1
- package/docs/errors/unknown-page.md +1 -1
- package/docs/errors/unmapped-glyph.md +1 -1
- package/docs/errors/unnumbered-heading-misused.md +1 -1
- package/docs/errors/unset-object.md +1 -1
- package/docs/errors/unsupported-filter.md +1 -1
- package/docs/errors/unsupported-image.md +1 -1
- package/docs/errors/unsupported-layout-option.md +1 -1
- package/docs/errors/unsupported-security-handler.md +1 -1
- package/docs/errors/unsupported-version.md +1 -1
- package/docs/errors/untagged-content.md +1 -1
- package/docs/errors/warnings-truncated.md +1 -1
- package/docs/errors/wasm-trap.md +1 -1
- package/docs/errors/whole-font-rebuilt.md +1 -1
- package/docs/errors/worker-crashed.md +1 -1
- package/docs/errors/worker-failed.md +1 -1
- package/docs/errors/worker-version-mismatch.md +1 -1
- package/docs/errors/would-invalidate-signatures.md +1 -1
- package/docs/errors/wrong-document.md +1 -1
- package/docs/errors/wrong-password.md +1 -1
- package/docs/errors/xobject-cycle.md +1 -1
- package/docs/errors/xref-repaired.md +1 -1
- package/docs/errors/xrefstm-ignored.md +1 -1
- package/docs/llms.txt +7 -1
- package/docs/pages/concepts/dependencies.md +2 -2
- package/docs/pages/concepts/drawing-pages.md +76 -0
- package/docs/pages/concepts/errors-and-warnings.md +6 -2
- package/docs/pages/concepts/how-lamina-thinks.md +13 -1
- package/docs/pages/concepts/pages-and-coordinates.md +9 -1
- package/docs/pages/guides/accessible-pdfs.md +3 -1
- package/docs/pages/guides/archival-pdfs.md +5 -1
- package/docs/pages/guides/edit-a-pdf.md +8 -2
- package/docs/pages/guides/flowing-pages.md +379 -0
- package/docs/pages/guides/fonts-and-text.md +3 -1
- package/docs/pages/guides/images-and-vectors.md +3 -1
- package/docs/pages/guides/keep-the-page-responsive.md +8 -4
- package/docs/pages/guides/links-outlines-and-metadata.md +3 -1
- package/docs/pages/guides/open-large-files.md +69 -0
- package/docs/pages/guides/password-protected-files.md +1 -1
- package/docs/pages/guides/save-a-pdf.md +12 -2
- package/docs/pages/guides/test-generated-pdfs.md +324 -0
- package/docs/pages/guides/untrusted-files.md +3 -1
- package/docs/pages/index.md +2 -2
- package/docs/pages/install.md +9 -5
- package/docs/pages/quick-start/browser.md +5 -1
- package/docs/pages/quick-start/bun.md +5 -1
- package/docs/pages/quick-start/deno.md +5 -1
- package/docs/pages/quick-start/node.md +5 -1
- package/docs/pages/quick-start/rust.md +6 -2
- package/docs/pages/quick-start/workers.md +2 -2
- package/docs/pages/recipes/cloudflare-worker.md +1 -1
- package/docs/pages/recipes/element-flow.md +248 -0
- package/docs/pages/recipes/extract-markdown.md +44 -6
- package/docs/pages/recipes/generate-then-edit.md +13 -6
- package/docs/pages/recipes/hello.md +13 -6
- package/docs/pages/recipes/images-and-vectors.md +13 -6
- package/docs/pages/recipes/invoice.md +13 -6
- package/docs/pages/recipes/links-and-outlines.md +13 -6
- package/docs/pages/recipes/multilingual.md +13 -6
- package/docs/pages/recipes/open-untrusted.md +1 -1
- package/docs/pages/recipes/pdf-a-archive.md +13 -6
- package/docs/pages/recipes/pdf-a3-invoice-with-xml.md +13 -6
- package/docs/pages/recipes/pdf-ua-report.md +13 -6
- package/docs/pages/recipes/report.md +2 -2
- package/docs/pages/recipes/web-worker-client.md +1 -1
- package/docs/pages/recipes.md +3 -2
- package/docs/pages/reference/benchmarks.md +93 -0
- package/docs/pages/reference/changelog.md +49 -1
- package/docs/pages/reference/codes.md +1 -1
- package/docs/pages/reference/glossary.md +1 -1
- package/docs/pages/reference/rust.md +11 -11
- package/docs/pages/reference/stability.md +3 -3
- package/docs/pages/start/coding-agents.md +1 -1
- package/docs/pages/start/first-pdf.md +6 -2
- package/docs/pages/troubleshooting.md +1 -1
- package/docs/schemas/error.schema.json +18 -1
- package/package.json +4 -2
- package/schemas/error.schema.json +18 -1
|
@@ -43,6 +43,8 @@ export const PAGES = {
|
|
|
43
43
|
"extract-table-limit": "# `extract-table-limit`\n\n- Type: warning\n- Kind: `limit` (a `Limits` value or another resource bound was hit)\n\n## What happened\n\nA page's ruling lines would have made a table with more cells than `ExtractLimits::max_table_cells` allows, or the page drew so many lines that matching them all would cost too much. Extraction made no table from those lines; their text is still in the page's paragraphs.\n\n## Why\n\nA page drawn with thousands of lines, such as a large grid, a chart's gridlines or a file built to slow extraction down. To find a table, extraction compares every horizontal line with every vertical one, so the work grows with the square of the line count.\n\n## How to fix\n\nRaise `max_table_cells` if the page really holds a table that big.\n\n## Example\n\n```rust\nlet mut options = laminapdf_extract::ExtractOptions::default();\noptions.limits.max_table_cells = 50_000;\n```\n\n## Data fields\n\n- `limit`: the limit that was reached.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [L3b](../todos/done/L3b-extract-tables-and-serialisers.md): tables and extraction output\n",
|
|
44
44
|
"extract-struct-tree-ignored": "# `extract-struct-tree-ignored`\n\n- Type: warning\n- Kind: `input` (a problem with the PDF file)\n\n## What happened\n\nThe page is tagged, but its structure tree didn't pass the checks that decide whether to trust it, so extraction read the page in layout order instead.\n\n## Why\n\nA structure tree gives a page's reading order, but trees are often incomplete or wrong. Extraction uses a page's tree only when its elements cover at least 80% of the page's visible text, not counting headers, page numbers and other text the file marks as page furniture. Its order must also jump back up into an earlier column at most once in ten moves from block to block. A tree written by a tool that tags only some of the text, or that tags it in drawing order, fails one of the checks.\n\n## How to fix\n\nNothing to do: the page reads in layout order, as an untagged page would. To use the tree anyway, extract with `ReadingOrder::Tagged` (`readingOrder: \"tagged\"`). Like every warning, it fails the call in strict mode.\n\n## Example\n\nA report whose tool tagged only its headings: the tree covers a tenth of the text, so the reason is `coverage`.\n\n## Data fields\n\n- `reason`: `coverage` or `order`, the check that failed.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md): the extraction output and the reading-order sources\n",
|
|
45
45
|
"extract-untagged-content": "# `extract-untagged-content`\n\n- Type: warning\n- Kind: `input` (a problem with the PDF file)\n\n## What happened\n\nThe page was read in its structure tree's order, but some of its visible text isn't in the tree and isn't marked as an artifact. Extraction kept that text and put it after the tree's blocks, in layout order.\n\n## Why\n\nIn a tagged file, every piece of visible content should belong to a structure element or be marked as an artifact (ISO 32000-2 §14.8.2.2). Text that is neither has no place in the tree's order. A tool that adds text after tagging a document, such as a stamp or a page number, often leaves text like this.\n\n## How to fix\n\nNothing to do in Lamina PDF. To give that text its place in the reading order, tag it in the file, or mark it as an artifact if it isn't content. Like every warning, it fails the call in strict mode.\n\n## Example\n\nA tagged contract with a \"DRAFT\" stamp drawn after tagging: the stamp's text comes after the contract's blocks.\n\n## Data fields\n\n- `chars`: how many characters (spaces left out) lie outside the tree.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md): the extraction output and the reading-order sources\n",
|
|
46
|
+
"extract-needs-ocr": "# `extract-needs-ocr`\n\n- Type: warning\n- Kind: `unsupported` (something Lamina PDF can't do yet)\n\n## What happened\n\nThe page has no text that extraction can use, so the page's Markdown, text and blocks are empty or close to it. Each page's `textLayer` in the extraction says why, and this warning names the pages whose status is `needs-ocr` or `ocr-layer`.\n\n## Why\n\nA page's text comes from its fonts. Some pages draw their words in other ways:\n\n- a scanned page is one image, with no text at all;\n- a page made searchable by OCR has an image under invisible text, which extraction leaves out of the blocks because a reader can't see it;\n- outlined text is drawn as shapes, not glyphs;\n- a font without a Unicode mapping draws glyphs that extraction can't turn into characters.\n\n## How to fix\n\nSend the pages this warning names to OCR or a vision model. On an `ocr-layer` page you can instead keep the existing OCR layer: extraction lists its text under `dropped` as `invisible` when you set `drop: { keepSpans: true }` (`DropOptions::keep_spans` in Rust). Like every warning, it fails the call in strict mode.\n\n## Example\n\nA scanned contract: every page is `needs-ocr`, and the extraction's Markdown is empty.\n\n## Data fields\n\n- `status`: the page's text-layer status, `needs-ocr` or `ocr-layer`.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md): the extraction output and hidden text\n",
|
|
47
|
+
"extract-column-order-uncertain": "# `extract-column-order-uncertain`\n\n- Type: warning\n- Kind: `unsupported` (something Lamina PDF can't do yet)\n\n## What happened\n\nExtraction read the page's columns in an order its layout rules had to guess, so the page's blocks may be in the wrong order. The blocks the guess concerns have a `confidence` of 0.5 instead of 0.75; the order itself is the rules' best one.\n\n## Why\n\nA PDF stores where each piece of text is drawn, not the order to read it in, so extraction works the order out from the layout: columns first, top to bottom. Three layouts leave that order in doubt, and the warning's `reason` names which one it found:\n\n- `narrow-gutter`: two columns sit closer together than a font size, so lines may have been read straight across both columns.\n- `columns-revisited`: a block across the gutter, such as a pull quote with the text wrapped round it, cut the columns into rows, so the order leaves a column and comes back to it.\n- `near-grid`: blocks that look like an unruled table, with one cell wrapped onto a second line, were read column by column; read by rows, the order would differ.\n\nA page that mixes horizontal and vertical writing raises [`extract-reading-order-ambiguous`](extract-reading-order-ambiguous.md) instead.\n\n## How to fix\n\nCheck the page's text, or send the page to a layout model, which reads columns from the page's image. A tagged file read in its structure tree's order never raises this warning. Like every warning, it fails the call in strict mode.\n\n## Example\n\nA newsletter page with two columns set 7 pt apart: each line of the extracted text runs across both columns, and the page is warned with `narrow-gutter`.\n\n## Data fields\n\n- `reason`: `narrow-gutter`, `columns-revisited` or `near-grid`, the first check that doubted the order.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md): the extraction output and reading order\n",
|
|
46
48
|
"not-pdf": "# `not-pdf`\n\n- Type: error\n- Kind: `input` (the input is malformed beyond what tolerance repairs)\n\n## What happened\n\nThe input does not look like a PDF at all.\n\n## Why\n\nThe bytes are empty, or no `n g obj` header appears anywhere in them: an HTML error page saved as `.pdf`, a different format, or the wrong buffer.\n\n## How to fix\n\nCheck that you passed the right bytes.\n\n## Example\n\n```rust\nlet err = laminapdf::Document::open_bytes(b\"<html>…</html>\".to_vec(), Default::default()).unwrap_err();\nassert_eq!(err.code(), \"not-pdf\");\n```\n\n## Data fields\n\nNone.\n",
|
|
47
49
|
"missing-root": "# `missing-root`\n\n- Type: error\n- Kind: `input` (the input is malformed beyond what tolerance repairs)\n\n## What happened\n\nNo document catalog (`/Root`) was found, even after repair.\n\n## Why\n\nThe file is damaged beyond repair.\n\n## How to fix\n\nUse another copy of the file.\n\n## Example\n\n```text\ntrailer << /Size 3 >> % no /Root, and no object with /Type /Catalog in the file\n```\n\nRepair found no catalog to use, so `open` fails.\n\n## Data fields\n\nNone.\n",
|
|
48
50
|
"reference-cycle": "# `reference-cycle`\n\n- Type: error\n- Kind: `input` (the input is malformed beyond what tolerance repairs)\n\n## What happened\n\nA reference chain or the page tree loops back on itself.\n\n## Why\n\nDamaged or hostile files.\n\n## How to fix\n\nUse another copy of the file.\n\n## Example\n\n```text\n5 0 obj 6 0 R endobj\n6 0 obj 5 0 R endobj\n```\n\nResolving object 5 leads back to itself; the call fails instead of looping. A page tree whose `/Kids` lead back to an ancestor fails the same way.\n\n## Data fields\n\nNone.\n",
|
|
@@ -87,6 +89,7 @@ export const PAGES = {
|
|
|
87
89
|
"wrong-document": "# `wrong-document`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`FontRegistry::finish_fonts` was given a document in which a font's reserved object is not a free number reserved in that document.\n\n## Why\n\nA `FontRegistry` belongs to one document: `reference` reserves numbers in the document it is given, and `finish_fonts` fills those numbers. Finishing into another document would overwrite its objects, so nothing is written.\n\n## How to fix\n\nUse one `FontRegistry` per document, and pass `finish_fonts` the document its `reference` calls used.\n\n## Example\n\n```rust\nlet id = registry.reference(key, &doc_a)?;\nregistry.finish_fonts(&mut doc_b.edit())?; // wrong-document: the fonts were reserved in doc_a\n```\n\n## Data fields\n\n- `object`: the reserved object number.\n",
|
|
88
90
|
"invalid-feature": "# `invalid-feature`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nAn OpenType feature setting given to the shaper (`\"liga=0\".parse::<Feature>()`) did not parse.\n\n## Why\n\nFeature settings use HarfBuzz's syntax without ranges: `tag` or `+tag` (on), `-tag` (off), `tag=N`, `tag=on` or `tag=off`, where the tag is one to four printable ASCII characters. A sign together with a value (`+liga=1`), an empty or longer tag, or a value that is not a non-negative integer is refused.\n\n## How to fix\n\nWrite the setting as `liga=0`, `-liga`, `smcp` or `aalt=2`, or build it with `Feature::new(OpenTypeTag::new(b\"liga\"), 0)`.\n\n## Example\n\n```rust\nlet f: Feature = \"liga[3:5]=0\".parse()?; // invalid-feature: ranges are not supported\n```\n\n## Data fields\n\n- `feature`: the setting as given (**untrusted**: caller text).\n",
|
|
89
91
|
"invalid-text-range": "# `invalid-text-range`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA byte range of a text given to `Shaper::shape_range`, `BidiParagraph::visual_runs` or `BidiParagraph::line_levels`, or the range of a `ShapedRun` given to `pdf_run`, is past the end of the text or does not start and end on character boundaries.\n\n## Why\n\nRanges are byte offsets into UTF-8 text; a range that cuts a character in two (or reaches past the end) names no text.\n\n## How to fix\n\nTake ranges from Lamina PDF's own results (`line_breaks`, `itemize`, `break_lines`, `ShapedRun::text_range`), or check them with `str::get` first, and pass the same text the range was computed on.\n\n## Example\n\n```rust\nshaper.shape_range(&font, \"héllo\", 0..2, &options)?; // byte 2 is inside 'é'\n```\n\n## Data fields\n\n- `start`, `end`: the range (bytes).\n- `len`: the text's length (bytes).\n",
|
|
92
|
+
"invalid-spans": "# `invalid-spans`\n\n- Type: error\n- Kind: `usage` (the caller passed something invalid)\n\n## What happened\n\nThe styled spans passed to `break_spans` don't cover the paragraph's text exactly once, in order, or name fonts it can't use. One of these is true:\n\n- two spans leave a gap, overlap, or come out of order;\n- the last span stops before the end of the text, or runs past it;\n- a span starts or ends inside a character, or between a letter and its accent;\n- a span lists no fonts, or a font index past the end of the list.\n\n## Why\n\nEach character's font, size and language come from the span that holds it. A character in no span, or in two, would have no style or two styles, so Lamina PDF refuses the spans rather than guess. A letter and its accent are drawn as one glyph cluster, so they can't take two styles. An index past the end of the font list names no font.\n\n## How to fix\n\nList the spans in the order of the text. Start the first at byte 0, start each span where the one before it ends, and end the last at the text's length. Take span ends from `grapheme_boundaries` or `str::len`, so that they fall between clusters. List at least one font per span, each an index into the font list. An empty text needs no spans.\n\n## Example\n\n```rust\nlet text = \"Hello, world\";\nlet spans = [StyledSpan::new(0..5), StyledSpan::new(6..12)]; // byte 5 is in no span\nbreak_spans(&shaper, &fonts, text, &spans, &options)?; // invalid-spans\n```\n\n## Data fields\n\n- `at`: the byte offset where the spans stop covering the text, or where the span with a bad font list starts.\n",
|
|
90
93
|
"unsupported-layout-option": "# `unsupported-layout-option`\n\n- Type: error\n- Kind: `unsupported` (valid input that Lamina PDF doesn't implement)\n\n## What happened\n\n`break_lines` was given a layout option Lamina PDF does not implement yet: `LayoutOptions::justify` set to `true`.\n\n## Why\n\nJustification (stretching inter-word gaps, kashida) is reserved for a later plan (research 03 §7.6); silently ignoring the option would lay out ragged lines the caller did not ask for.\n\n## How to fix\n\nLeave `justify` at `false` and pick an `Alignment` (start, end, left, right or centre).\n\n## Example\n\n```rust\nlet options = LayoutOptions { justify: true, ..LayoutOptions::new(300.0, 12.0) };\nbreak_lines(&shaper, &fonts, text, &options)?; // unsupported-layout-option\n```\n\n## Data fields\n\n- `option`: the option's name (fixed text).\n",
|
|
91
94
|
"font-mismatch": "# `font-mismatch`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`pdf_run` was given a shaped run and the key of a font other than the one the run was shaped with. Nothing was recorded in the registry.\n\n## Why\n\nGlyph IDs, advances and units per em only mean something in the font that produced them; drawing them with another font would show the wrong glyphs and wrong text.\n\n## How to fix\n\nRegister every font of a layout and pass the key of the run's own font: each `LineRun::font` is an index into the font list given to `break_lines`.\n\n## Example\n\n```rust\nlet run = shaper.shape(¬o, text, &options)?;\npdf_run(&run, text, &mut registry, roboto_key)?; // font-mismatch: shaped with Noto\n```\n\n## Data fields\n\n- `font`: the registered font's PostScript name (**untrusted**: read from the font).\n- `shaped_with`: the PostScript name of the font the run was shaped with (**untrusted**: read from the font).\n",
|
|
92
95
|
"encoding-full": "# `encoding-full`\n\n- Type: error\n- Kind: `limit` (a `Limits` value or another resource bound was hit)\n\n## What happened\n\nA standard 14 font had no free one-byte code left for another glyph in this document.\n\n## Why\n\nA standard 14 font is a simple font: text is written one byte per character, so one font resource addresses at most 256 glyphs (ISO 32000-2 §9.6.5). Lamina PDF writes the Latin fonts in `WinAnsiEncoding`, and gives each glyph of the standard Latin character set outside it (`Lslash`, `Scedilla`, `minus`, …) one of the 37 codes `WinAnsiEncoding` leaves undefined, through `/Differences`.\n\nA document that draws more such glyphs with one font than there are free codes runs out. Assignment is all or nothing: when one `encode` call needs more new codes than are free, none are assigned and nothing of the text is recorded.\n\n## How to fix\n\nEmbed a font (`Font::from_bytes`), which addresses every glyph through a Type 0 font, or split the text across two registrations of the standard font (each is its own font resource with its own codes).\n\n## Example\n\nDrawing more than 37 different non-WinAnsi Latin glyphs (Ā, ă, Ą, …) with `Standard14::Helvetica` in one document: the 38th has no free code in the font's `/Differences`, so the call fails with `encoding-full`.\n\n## Data fields\n\n- `font`: the standard font's PostScript name (fixed text: one of the fourteen).\n- `limit`: how many codes `/Differences` can assign for this font.\n- `free`: how many of them were still free; the text needed more, so none were assigned.\n",
|
|
@@ -105,6 +108,8 @@ export const PAGES = {
|
|
|
105
108
|
"page-index-out-of-range": "# `page-index-out-of-range`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA link (`LinkTarget::Page`), an outline item or a named destination (`Builder::destination`) names a page index the document doesn't have when the build finishes.\n\n## Why\n\nPage targets are resolved when `Builder::finish` (or `Appender::finish`) runs, so a link can name a page added after its own; by then every index must be one of the document's pages. Indexes are 0-based.\n\n## How to fix\n\nUse an index below the document's page count, or add the page before finishing.\n\n## Example\n\n```rust\nsurface.link(rect, LinkTarget::Page { index: 5, fit: Fit::Page }, None);\nbuilder.finish()?; // page-index-out-of-range: the document has 2 pages\n```\n\n## Data fields\n\n- `index`: the 0-based index given.\n- `count`: the number of pages.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0027](../decisions/0027-coordinates-units-and-page-indexing.md) §6\n",
|
|
106
109
|
"unknown-destination": "# `unknown-destination`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA link or outline item of a new document targets `LinkTarget::Named(name)`, but `Builder::destination` never defined that name.\n\n## Why\n\nA named destination is looked up in the document's `/Names /Dests` tree (ISO 32000-2 §12.3.2.4); a name that isn't there goes nowhere in every viewer.\n\n## How to fix\n\nDefine the name with `Builder::destination(name, page_index, fit)` before `Builder::finish`, or link to the page directly with `LinkTarget::Page`.\n\n## Example\n\n```rust\nsurface.link(rect, LinkTarget::Named(\"appendix\".into()), None);\nbuilder.finish()?; // unknown-destination: call builder.destination(\"appendix\", …) first\n```\n\n## Data fields\n\n- `name`: the name as given (untrusted: caller text, never in the message).\n",
|
|
107
110
|
"invalid-page-labels": "# `invalid-page-labels`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nThe ranges given to `Builder::page_labels` can't be written as a `/PageLabels` number tree.\n\n## Why\n\nISO 32000-2 §7.7.2 and §12.4.2: the tree must have an entry for page index 0, its keys are page indexes in increasing order, and a label range's first number (`/St`) is at least 1. A range starting past the document's last page would label nothing.\n\n## How to fix\n\nGive the ranges sorted by first page, the first starting at page 0, each start a page of the document, and numbers from 1 (`PageLabel::with_first`).\n\n## Example\n\n```rust\nbuilder.page_labels([PageLabel::new(1, Some(LabelStyle::Decimal))]); // invalid-page-labels at finish: no range starts at page 0\n```\n\n## Data fields\n\n- `what`: what is wrong (fixed text).\n",
|
|
111
|
+
"tag-element-not-open": "# `tag-element-not-open`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Surface::resume` or `Builder::close_element` was given a structure element that isn't open. When `resume` names one, the page's `PageBuilder::finish` fails.\n\n## Why\n\nAn element that continues across pages is open from `Surface::open_element` until `Builder::close_element` writes it, and only then. The element named was one of these:\n\n- closed already;\n- opened by another builder;\n- opened inside an artifact, so it is part of the artifact (ISO 32000-2 §14.8.2.2);\n- opened on a page added to an existing document, which is never tagged;\n- opened on a page whose `PageBuilder::finish` failed, so it was never written.\n\n## How to fix\n\nOpen the element on a page of the same builder, outside every artifact, and close it once, after its last page is finished.\n\n## Example\n\n```rust\nlet paragraph = page.surface().open_element(TagKind::P);\npage.finish()?;\nbuilder.close_element(paragraph)?;\nbuilder.close_element(paragraph)?; // tag-element-not-open: closed already\n```\n\n## Data fields\n\nNone.\n",
|
|
112
|
+
"tag-element-unclosed": "# `tag-element-unclosed`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Builder::finish` was called while structure elements opened with `Surface::open_element` were still open.\n\n## Why\n\nAn element that continues across pages is written when `Builder::close_element` closes it, since only then is its content complete. An element never closed would leave the structure tree with a reference to an element that doesn't exist (ISO 32000-2 §14.7.2), so the build stops instead.\n\n## How to fix\n\nClose every element from `Surface::open_element` with `Builder::close_element` once its last page is finished, before `Builder::finish`.\n\n## Example\n\n```rust\nlet paragraph = page.surface().open_element(TagKind::P);\npage.finish()?;\nbuilder.finish()?; // tag-element-unclosed: the paragraph is still open\n```\n\n## Data fields\n\n- `count`: how many elements are still open.\n",
|
|
108
113
|
"profile-version-conflict": "# `profile-version-conflict`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`BuildOptions::with_version(PdfVersion::V2_0)` was combined with a conformance profile (`BuildOptions::with_profile`) that is built on PDF 1.7. `Builder::finish` wrote nothing.\n\n## Why\n\nThe PDF/UA-1 standard for accessible PDF (ISO 14289-1) and the PDF/A-2 and PDF/A-3 archival standards (ISO 19005-2 and -3) build their rules on ISO 32000-1, which is PDF 1.7. A file that says it is PDF 2.0 can't conform to them. Validators such as veraPDF, the open-source PDF/A and PDF/UA validator, check the header first.\n\n## How to fix\n\nLeave the version at its default, 1.7 (or choose a lower one: the builder raises it to what the content needs). PDF 2.0 has its own profiles, PDF/A-4 and PDF/UA-2, which Lamina PDF doesn't write yet.\n\n## Example\n\n```rust\nlet options = BuildOptions::default()\n .with_version(PdfVersion::V2_0)\n .with_profile(Profile::PdfA2b);\nBuilder::new(options).finish()?; // profile-version-conflict\n```\n\n## Data fields\n\n- `profile`: the profile, such as `PDF/A-2b`.\n",
|
|
109
114
|
"missing-title": "# `missing-title`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA PDF/UA-1 document (`Profile::PdfUa1`) reached `Builder::finish` without a title: `Builder::metadata` was never called, or its `Metadata` has no title, or the title is blank.\n\n## Why\n\nA screen reader announces the title first, so a document without one is hard to tell apart from others. The PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.1) requires a title in the document's metadata. The title is `dc:title` in the XMP packet, the XML metadata stream that the builder writes from `Metadata`. The standard also asks viewers to show the title in the title bar instead of the file name (`/DisplayDocTitle`, which the builder writes for you). This is condition 06-003 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nGive the document a title that says what it is.\n\n## Example\n\n```rust\nbuilder.metadata(Metadata::default().with_title(\"Quarterly report, Q3 2026\"));\n```\n\n## Data fields\n\nNone.\n",
|
|
110
115
|
"missing-lang": "# `missing-lang`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA PDF/UA-1 document (`Profile::PdfUa1`) reached `Builder::finish` without a natural language: `Builder::lang` was never called, or was given a blank tag.\n\n## Why\n\nA screen reader picks its voice and pronunciation from the document's language (`/Lang` in the catalog, ISO 32000-2 §14.9.2). The PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.2) requires that the language of all text can be determined. These are conditions 11-001 and 11-006 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nSet the document's language with a BCP 47 tag, the standard language code of the web, such as `en-GB` or `fr`. Text in another language can carry its own tag with `Tag::with_lang`.\n\n## Example\n\n```rust\nbuilder.lang(\"en-GB\");\n```\n\n## Data fields\n\nNone.\n",
|
|
@@ -116,16 +121,28 @@ export const PAGES = {
|
|
|
116
121
|
"link-without-structure": "# `link-without-structure`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder PDF/UA-1, a link annotation has no `Link` structure element. The builder gives every link one automatically, except a link drawn inside an artifact, which stays outside the structure.\n\n## Why\n\nA screen reader finds links through the structure tree, so a link inside decoration can't be reached. The PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.18.5) requires each link annotation to be nested in a `Link` element. This is condition 28-011 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nDraw the link outside `Surface::artifact`, next to the text it belongs to; the builder then wraps it in a `Link` element.\n\n## Example\n\n```rust\nsurface.artifact(ArtifactKind::Layout, |s| {\n s.link(rect, LinkTarget::Uri(\"https://example.com\".into()), Some(\"Example\".into()));\n Ok(())\n})?;\nbuilder.finish()?; // link-without-structure\n```\n\n## Data fields\n\n- `page`: the page's index (0-based).\n- `count`: how many links on that page lack a `Link` element.\n",
|
|
117
122
|
"link-without-contents": "# `link-without-contents`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder PDF/UA-1, a link annotation has no description: `Surface::link` or `TextRun::link` was called with `None` (or an empty string) as its contents.\n\n## Why\n\nA screen reader announces a link by its `/Contents`, its alternate description. The PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.18.5) requires one on every link. This is condition 28-012 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nPass a short description of where the link goes as the link's contents.\n\n## Example\n\n```rust\nsurface.link(rect, LinkTarget::Uri(\"https://example.com/pay\".into()), None);\nbuilder.finish()?; // link-without-contents: pass Some(\"Pay the invoice online\".into())\n```\n\n## Data fields\n\n- `page`: the page's index (0-based).\n",
|
|
118
123
|
"font-not-embedded": "# `font-not-embedded`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nText was drawn with one of the standard 14 fonts (`Builder::standard_font`) under PDF/UA-1 or a PDF/A profile. The standard 14 fonts are never embedded: viewers substitute their own.\n\n## Why\n\nThe PDF/A standard for archival PDF (ISO 19005-2 §6.2.11.4.1) needs every font embedded, so the document looks the same everywhere in the future. The PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.21.4.1) needs it too, so viewers can render the text and map it to characters reliably. This is condition 31-009 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nLoad a font file with `Builder::font` (or `Builder::font_bytes` in the façade): Lamina PDF embeds the subset of glyphs you draw.\n\n## Example\n\n```rust\nlet bold = builder.standard_font(Standard14::HelveticaBold)?;\nsurface.text(\"Invoice\", &bold, Pt::new(24.0), at)?;\nbuilder.finish()?; // font-not-embedded under Profile::PdfA2b\n```\n\n## Data fields\n\n- `profile`: the profile, such as `PDF/A-2b`.\n- `font`: the font's PostScript name, such as `Helvetica-Bold`.\n",
|
|
119
|
-
"glyph-without-unicode": "# `glyph-without-unicode`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder PDF/A-2u or PDF/UA-1, a glyph was drawn
|
|
124
|
+
"glyph-without-unicode": "# `glyph-without-unicode`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder PDF/A-2u or PDF/UA-1, a glyph was drawn with no Unicode value, or with one that holds U+0000, U+FEFF or U+FFFE.\n\nA glyph that maps to the empty value doesn't fail. Shaping can draw one character with several glyphs: Noto Sans Arabic draws a beh as a dotless body and a dot. The body then carries the letter and the dot maps to the empty value, so the letter is read once.\n\n## Why\n\nSoftware can search, copy or read text aloud only when every glyph maps to a usable Unicode value. The PDF/A-2u archival standard (ISO 19005-2 §6.2.11.7.2) and the PDF/UA-1 standard for accessible PDF (ISO 14289-1 §7.21.7) both need that mapping. These are conditions 31-027 to 31-029 of the Matterhorn Protocol, the PDF Association's checklist of PDF/UA failures.\n\n## How to fix\n\nRemove the NUL characters (U+0000) from the text, and check what it was decoded from: a NUL usually means a UTF-16 string read as UTF-8, or the end of a C string. An archive that needs no accessibility can use PDF/A-2b instead, which doesn't need Unicode for every glyph. PDF/UA-1 has no such relaxed variant.\n\n## Example\n\n```rust\nsurface.text(\"\\u{0}Report\", &font, Pt::new(12.0), at)?;\nbuilder.finish()?; // glyph-without-unicode under Profile::PdfA2u\n```\n\n## Data fields\n\n- `profile`: the profile, `PDF/A-2u` or `PDF/UA-1`.\n- `font`: the font's PostScript name (untrusted: read from the font file).\n- `gid`: the glyph's ID in the font.\n",
|
|
120
125
|
"device-color-without-output-intent": "# `device-color-without-output-intent`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder a PDF/A profile, a page draws with `DeviceCMYK` (CMYK given as plain numbers, with no profile to say which inks they mean): a `Color::cmyk` colour or a CMYK JPEG.\n\n## Why\n\nThe PDF/A standard for archival PDF (ISO 19005) gives device colour a defined meaning through the document's output intent, which Lamina PDF writes as sRGB. That sRGB intent defines device RGB and gray, but not device CMYK, so ISO 19005-2 §6.2.4.3 forbids CMYK under it.\n\n## How to fix\n\nUse `Color::rgb` or `Color::gray`, convert CMYK images to RGB, or give CMYK colours an ICC profile with `Color::icc` (an ICC-based colour carries its own meaning).\n\n## Example\n\n```rust\nsurface.fill_color(Color::cmyk(0.0, 0.5, 1.0, 0.0));\nbuilder.finish()?; // device-color-without-output-intent under Profile::PdfA2b\n```\n\n## Data fields\n\n- `page`: the index (0-based) of the first page that uses `DeviceCMYK`.\n",
|
|
121
126
|
"embedded-file-forbidden": "# `embedded-file-forbidden`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Builder::attach` added a file to a document built under PDF/A-2b or PDF/A-2u.\n\n## Why\n\nThe PDF/A-2 standard for archival PDF (ISO 19005-2 §6.8) allows only attached files that are themselves PDF/A. Lamina PDF can't check what an attachment is, so it rejects every attachment under PDF/A-2 on purpose, PDF/A ones included. The PDF/A-3 standard for archival PDF (ISO 19005-3) allows files of any kind, provided they are associated with the document, which `Builder::attach` does.\n\n## How to fix\n\nChoose `Profile::PdfA3b` for documents that carry files, such as an e-invoice's XML, or leave the attachment out.\n\n## Example\n\n```rust\nlet options = BuildOptions::default().with_profile(Profile::PdfA2b);\nlet mut builder = Builder::new(options);\nbuilder.attach(Attachment::new(\"data.csv\", csv, \"text/csv\"));\nbuilder.finish()?; // embedded-file-forbidden: use Profile::PdfA3b\n```\n\n## Data fields\n\n- `profile`: the profile, such as `PDF/A-2b`.\n",
|
|
122
127
|
"embedded-file-without-mime-type": "# `embedded-file-without-mime-type`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nUnder a PDF/A profile, `Builder::attach` added a file with an empty MIME type. A MIME type names the file's format, such as `text/xml`.\n\n## Why\n\nSoftware reading an archive years later needs to know what each attached file is. The PDF/A-3 standard for archival PDF (ISO 19005-3 §6.8) requires every embedded file to name its MIME type in the `/Subtype` of its stream, and Lamina PDF writes no `/Subtype` for an empty one.\n\n## How to fix\n\nPass the file's MIME type to `Attachment::new`. For bytes of no particular type, use `application/octet-stream`.\n\n## Example\n\n```rust\nlet options = BuildOptions::default().with_profile(Profile::PdfA3b);\nlet mut builder = Builder::new(options);\nbuilder.attach(Attachment::new(\"invoice.xml\", xml, \"\"));\nbuilder.finish()?; // embedded-file-without-mime-type: pass \"text/xml\"\n```\n\n## Data fields\n\n- `profile`: the profile, such as `PDF/A-3b`.\n- `name`: the file's name (untrusted: the caller's text).\n",
|
|
128
|
+
"flow-content-too-large": "# `flow-content-too-large`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Builder::flow` found a figure, a single line of text or a table row taller than the body of a page: the space between the top and bottom margins. No page can hold it, so the flow stopped and added no pages. A line or row counts together with the footnotes it cites, since its notes go at the foot of its page.\n\n## Why\n\nA flow moves a figure to the next page when it doesn't fit, and splits a paragraph only between lines. A figure or a line taller than a whole page would fit on no page at all, and cutting it would hide part of it.\n\n## How to fix\n\nMake the figure narrower with `Figure::with_width`, so its height shrinks with it. For a line, use a smaller text size or a smaller line height. For a footnote, shorten the note or split it into two. Or give the page more room with a taller page size or smaller top and bottom margins.\n\n## Example\n\n```rust\nlet tall = Image::rgba(1, 10, &[0; 40])?; // ten times as tall as it is wide\nlet flow = Flow::new(PageTemplate::new(PageSize::A6)).block(FlowBlock::Figure(Figure::new(tall, \"A bar\")));\nbuilder.flow(&flow)?; // flow-content-too-large\n```\n\n## Data fields\n\n- `what`: what is too tall: `line`, `figure`, `table row`, or `footnote` when a line or table row and its footnotes fit on no page together.\n",
|
|
129
|
+
"flow-layout-unstable": "# `flow-layout-unstable`\n\n- Type: error\n- Kind: `internal` (a bug in Lamina PDF or a broken invariant)\n\n## What happened\n\n`Builder::flow` laid out a flow with a contents page four times, and the page numbers on the contents page still changed. The flow stopped and added no pages.\n\n## Why\n\nA contents page lists each heading with the page it starts on, but those pages aren't known until the flow is laid out. So the flow lays everything out, writes the numbers it found into the contents page, and lays out again to check them. Each entry keeps the same room for its number however wide the number is, so the contents page's length never depends on the numbers, and the second layout finds the same pages.\n\nThe flow still checks up to four layouts. This error means the numbers kept changing anyway, which points to a fault in Lamina PDF's layout rather than in your document.\n\n## How to fix\n\nReport the flow that fails, with the blocks and page template that produce it. Until it is fixed, a page break after the contents block may avoid the error, since the headings after it then start on pages of their own.\n\n## Example\n\n```rust\nlet flow = Flow::new(template)\n .block(FlowBlock::Contents(Contents::new(&style)))\n .block(FlowBlock::PageBreak) // the headings start on their own pages\n .block(FlowBlock::Heading(1, Paragraph::plain(\"Introduction\", &heading)));\nbuilder.flow(&flow)?;\n```\n\n## Data fields\n\nNone.\n",
|
|
130
|
+
"flow-keep-broken": "# `flow-keep-broken`\n\n- Type: warning\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Builder::flow` met blocks it was asked to keep on one page, and together they are taller than a page. The flow split them across pages anyway. Blocks are kept together by a `FlowBlock::Keep` group, or by a heading or a paragraph set to keep with the block after it.\n\n## Why\n\nBlocks that can't fit on one page can't be kept on one page. No layout can keep them together, so the flow doesn't look for one. It lays them out as it would without the rule, and every page still ends on a whole line.\n\n## How to fix\n\nKeep fewer blocks together: split a long `Keep` group into smaller ones, or turn off `keep_with_next` on a paragraph in a long chain. Or make the page taller, or its margins smaller, so the group fits.\n\n## Example\n\n```rust\nlet group = FlowBlock::Keep(vec![long_intro, long_paragraph]); // taller than a page\nlet report = builder.flow(&Flow::new(template).block(group))?;\nassert_eq!(report.warnings[0].code(), \"flow-keep-broken\");\n```\n\n## Data fields\n\n- `page`: the page the blocks start on, counted from 0 within the flow.\n",
|
|
131
|
+
"markdown-html-ignored": "# `markdown-html-ignored`\n\n- Type: warning\n- Kind: `unsupported` (valid input that Lamina PDF can't handle yet)\n\n## What happened\n\n`Builder::markdown` found raw HTML in the Markdown, such as a `<div>` block or an inline `<span>`, left it out of the PDF and laid out the rest as usual. The builder raises one warning for each HTML block and each inline HTML tag.\n\n## Why\n\nMarkdown lets authors mix in HTML, and a browser would draw it. Laying out HTML needs a web page's layout rules, which a PDF builder doesn't have. Rather than print the tags as text, the builder leaves the HTML out and says where it was.\n\n## How to fix\n\nWrite the content in Markdown instead: `**bold**` for `<b>`, a table for `<table>`, an image for `<img>`. If the HTML is only a comment, such as `<!-- draft -->`, remove it or ignore the warning.\n\n## Example\n\n```rust\nlet report = builder.markdown(\"Hello <span>there</span>\\n\", &MarkdownBuildOptions::new())?;\nassert_eq!(report.warnings[0].code(), \"markdown-html-ignored\");\n```\n\n## Data fields\n\n- `offset`: where the HTML starts, as a byte offset into the Markdown.\n",
|
|
132
|
+
"markdown-image-missing": "# `markdown-image-missing`\n\n- Type: warning\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Builder::markdown` met an image, such as ``, whose bytes weren't passed in. It left the image out of the PDF and laid out the rest of the document as usual.\n\n## Why\n\nThe builder reads no files and fetches nothing from the network, so it can only draw images the caller supplies. An image path the options don't list, or a web address, has nothing behind it.\n\n## How to fix\n\nRead the image yourself and pass it with `MarkdownBuildOptions::with_image`, under the same path the Markdown uses.\n\n## Example\n\n```rust\nlet chart = Image::png(&std::fs::read(\"chart.png\")?)?;\nlet options = MarkdownBuildOptions::new().with_image(\"chart.png\", chart);\nbuilder.markdown(\"\\n\", &options)?;\n```\n\n## Data fields\n\n- `offset`: where the image starts, as a byte offset into the Markdown.\n",
|
|
123
133
|
"render-too-large": "# `render-too-large`\n\n- Type: error\n- Kind: `limit` (a configured limit was exceeded)\n\n## What happened\n\nA render backend (`laminapdf-render`) refused a request that is too large. The tile has more than `max_render_pixels` pixels or more than `max_render_side` pixels on a side (the document's `RenderLimits`), or more than 65,535 pixels on a side for hayro. Or, for hayro, which reads the whole file, the input is longer than `max_input_bytes`.\n\n## Why\n\nPage sizes and zoom levels come from files and users, so a render could otherwise ask for a bitmap of any size. The limits are checked before anything is allocated. The defaults are 16,777,216 pixels per tile (4096 × 4096, iOS Safari's per-canvas cap), 16,384 pixels per side and 1 GiB of input.\n\n## How to fix\n\nAt high zoom, render the visible part of the page as tiles of 256 to 512 pixels (`RenderRequest::with_clip`) instead of the whole page. Raise the limits with `RenderOpenOptions::with_limits` only when the larger bitmap is intended.\n\n## Example\n\n```rust\nlet req = RenderRequest::page(0, 1000.0); // a letter page at 1000×: 612,000 × 792,000 pixels\ndoc.render(&req, &mut out, &CancelToken::new())?; // render-too-large\n```\n\n## Data fields\n\n- `width`, `height`: the tile's size (tile limits).\n- `limit`: the limit exceeded.\n- `unit`: `pixels`, `pixels per side` or `pixels per side (hayro)` (tile limits).\n- `len`: the input's length in bytes (the input limit, with `limit`).\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0004](../decisions/0004-render-backend.md) §1\n",
|
|
124
134
|
"render-failed": "# `render-failed`\n\n- Type: error\n- Kind: `input` (the input is malformed beyond what tolerance repairs)\n\n## What happened\n\nThe render engine (PDFium or hayro, `laminapdf-render`) could not open the document, or could not draw the page it was asked for.\n\n## Why\n\nThe engines have their own parsers. A file that Lamina PDF repairs may still be too damaged for an engine, or use a feature it can't draw. An engine failure (for example a panic inside hayro) is reported this way too, never as a crash.\n\n## How to fix\n\nCheck the document's warnings: a damaged file is usually reported there too. Try the other backend from the debug menu. If neither can draw the page, report the file with the backend name and version.\n\n## Example\n\n```rust\nlet doc = HayroBackend::new().open(Arc::new(bytes), &RenderOpenOptions::new())?; // render-failed for a file hayro can't parse\n```\n\n## Data fields\n\n- `backend`: `pdfium` or `hayro`.\n- `stage`: `open` or `render`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [C1a](../todos/done/C1a-hayro-parity-spike.md): the hayro parity spike, which saw such a panic once\n",
|
|
125
135
|
"render-backend-unavailable": "# `render-backend-unavailable`\n\n- Type: error\n- Kind: `io` (reading or writing outside Lamina PDF failed)\n\n## What happened\n\nThe PDFium backend (`laminapdf-render-pdfium`) could not load the PDFium library, so nothing can be rendered with it.\n\n## Why\n\nPDFium is bound at runtime, never linked at build time: the library has to be present on the machine. Lamina PDF looks for it only in the folder you name.\n\n## How to fix\n\nShip the PDFium library (`libpdfium.dylib`, `libpdfium.so` or `pdfium.dll`) with your app and pass its folder to `PdfiumBackend::bind(dir)`, or set `LAMINA_PDF_PDFIUM_DIR` to that folder for `PdfiumBackend::from_env()`.\n\n## Example\n\n```rust\nlet backend = PdfiumBackend::from_env()?; // render-backend-unavailable when the library isn't there\n```\n\n## Data fields\n\n- `backend`: `pdfium`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0004](../decisions/0004-render-backend.md) §3\n\nIn a checkout of Lamina PDF, `cargo xtask fetch-pdfium` fetches the pinned build and prints its `LAMINA_PDF_PDFIUM_DIR`.\n",
|
|
136
|
+
"model-failed": "# `model-failed`\n\n- Type: error\n- Kind: `internal` (something failed outside the caller's control)\n\n## What happened\n\nA layout model, an OCR engine or the page renderer that feeds them failed while an extraction was using it. The extraction stopped and returned no partial result.\n\n## Why\n\nModels are plug-ins: the extraction calls the model and the renderer it was given, and stops when either reports an error. The error's message is the plug-in's own, and never holds text from the document.\n\n## How to fix\n\nCheck the plug-in's own logs or setup: a missing weights file, a runtime that failed to load, a page too large to render. To get a result meanwhile, extract without the model; the rules alone still give every page's blocks.\n\n## Example\n\n```rust\nlet options = laminapdf::extract::ExtractOptions::new(); // no models: rules only\nlet extraction = doc.extract(&options)?;\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md) §6\n- [L3c](../todos/done/L3c-model-plugins.md)\n",
|
|
137
|
+
"model-result-unexpected": "# `model-result-unexpected`\n\n- Type: error\n- Kind: `usage` (the call itself is wrong)\n\n## What happened\n\nA model result was handed to an extraction job (`provide`) that wasn't waiting for one, or that was waiting for the other model's result: layout regions when it asked for OCR words, or the reverse.\n\n## Why\n\nA job whose models the host runs stops at each page that needs a result and says which one (`request()`). It takes exactly that result and nothing else, so results can't land on the wrong page.\n\n## How to fix\n\nCall `provide` only while `request()` returns a request, with the result its kind asks for: layout regions for a layout request, OCR words for an OCR request.\n\n## Example\n\n```rust\nwhile let laminapdf::Step::Progress { .. } = job.step(&doc, laminapdf::Budget::UNLIMITED)? {\n if let Some(request) = job.request().cloned() {\n job.provide(run_my_model(&request))?;\n }\n}\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md) §6\n- [L3c](../todos/done/L3c-model-plugins.md)\n",
|
|
138
|
+
"model-needs-host": "# `model-needs-host`\n\n- Type: error\n- Kind: `usage` (the call itself is wrong)\n\n## What happened\n\nAn extraction in one call (`extract`) was given a model whose results only the host can give: a model named as the host's (`ModelSlot::Host`), or a plug-in model with no page renderer to draw the pages it reads.\n\n## Why\n\nA one-call extraction runs to the end without stopping, so it can only use models it can call itself, on pages its renderer draws. A host's model answers through the extraction job, which stops at each page that needs a result.\n\n## How to fix\n\nStep an extraction job and hand it each result: `request()` says which page and resolution it needs, `provide(result)` gives it back. Or give the plug-in model a page renderer, so the extraction calls it between pages.\n\n## Example\n\n```rust\nlet mut job = doc.extract_job(&options)?;\nloop {\n if let laminapdf::Step::Done(extraction) = job.step(&doc, laminapdf::Budget::UNLIMITED)? {\n break extraction;\n }\n if let Some(request) = job.request().cloned() {\n job.provide(run_my_model(&request))?;\n }\n}\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md) §6\n- [L3c](../todos/done/L3c-model-plugins.md)\n",
|
|
126
139
|
"cancelled": "# `cancelled`\n\n- Type: error\n- Kind: `cancelled` (a `CancelToken` stopped the work)\n\n## What happened\n\nThe `CancelToken` passed to a job, or to a run-to-completion call such as `Document::save`, was cancelled. The call returned at its next check: the start of a step, a budget check, or the next object or page of a long loop.\n\n## Why\n\nThe caller (or a host on its behalf: an `AbortSignal`, Ctrl-C, a task cancellation) asked for the work to stop.\n\n## How to fix\n\nNothing: this is the outcome that was asked for. The job is finished, a cancelled save left the document as it was (`Dirty`, nothing written), and a cancelled read returned no partial result. Start a new job with a fresh token to try again.\n\n## Example\n\n```rust\nlet cancel = laminapdf::CancelToken::new();\ncancel.cancel();\nlet err = doc.save_with(&laminapdf::SaveOptions::new(), &cancel).unwrap_err();\nassert_eq!(err.code(), \"cancelled\");\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0028](../decisions/0028-facade-rules-jobs-and-cancellation.md) §5\n",
|
|
127
140
|
"job-finished": "# `job-finished`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\n`step` was called on a job that had already returned its result, failed or been cancelled.\n\n## Why\n\nA job ends with its first `Step::Done`, or with its first error: an error ends the job. A step loop that keeps going after either reaches this.\n\n## How to fix\n\nStop stepping once a step returns `Done` or an error. To run the work again, create a new job.\n\n## Example\n\n```rust\nlet mut job = doc.save_job(&laminapdf::SaveOptions::new());\nwhile let laminapdf::Step::Progress { .. } = job.step(&mut doc, laminapdf::Budget::UNLIMITED)? {}\nassert_eq!(job.step(&mut doc, laminapdf::Budget::UNLIMITED).unwrap_err().code(), \"job-finished\");\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0028](../decisions/0028-facade-rules-jobs-and-cancellation.md) §3\n",
|
|
128
141
|
"document-changed": "# `document-changed`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\nA job's `step` was given a document other than the one the job was created from, or that document changed since: a committed transaction, an undo, a redo, a save or a rebase. Every step checks the document's instance and revision before any work, and the job is now finished.\n\n## Why\n\nJobs don't borrow the document, so other calls can run between two steps. A save or a read that went on after an edit would mix two states of the document, so the job stops instead.\n\n## How to fix\n\nPass the document the job was created from, don't change it while the job runs, and create a new job after a change. A failed save left the document as it was.\n\n## Example\n\n```rust\nlet mut job = doc.save_job(&laminapdf::SaveOptions::new());\ndoc.apply(vec![laminapdf::Op::from(set_info)])?; // the revision moves on\nassert_eq!(job.step(&mut doc, laminapdf::Budget::UNLIMITED).unwrap_err().code(), \"document-changed\");\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0028](../decisions/0028-facade-rules-jobs-and-cancellation.md) §3\n",
|
|
142
|
+
"revision-index-out-of-range": "# `revision-index-out-of-range`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\n`Document::open_revision` was asked for a revision the file doesn't have.\n\n## Why\n\nRevisions are numbered from 0, the original file, to one less than `Document::revision_count`, the latest revision. A file that was never updated, or one opened by repairing a broken cross-reference table, has one revision.\n\n## How to fix\n\nAsk for an index below `revision_count()`.\n\n## Example\n\n```rust\nlet count = doc.revision_count()?; // 2\ndoc.open_revision(count, OpenOptions::default())?; // revision-index-out-of-range\n```\n\n## Data fields\n\n- `index`: the index asked for.\n- `count`: how many revisions the file has.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [T2b](../todos/done/T2b-check-failed-redactions.md): `revision_count` and `open_revision`\n",
|
|
143
|
+
"covered-text": "# `covered-text`\n\n- Type: warning\n- Kind: `security` (encryption, permissions or signatures block the call, or look tampered with)\n\n## What happened\n\nA page draws text and then paints something opaque over it: a filled box, an image or an annotation. A reader sees the box, but the text under it is still in the file, so copying, search and every text extractor still get it.\n\n## Why\n\nDrawing a black box over a name is the most common failed redaction. A PDF keeps every glyph its content draws, whatever is painted over it later, so the box hides the words on screen and in print without removing them. Extraction already leaves such text out of its blocks and lists it under `dropped` as `covered`; this warning says how much of it each page has.\n\n## How to fix\n\nRemove the text itself with a tool that deletes what a redaction covers, then save the file as a full rewrite, so no earlier revision keeps it either. If the box is part of the design and the text under it is meant to be there, you can ignore the warning.\n\n## Example\n\nA page draws \"Pay John Smith now.\" and then a black rectangle over \"John Smith\". `laminapdf check` reports `covered-text` for page 0 with `chars` 9, and `laminapdf extract` gives `Pay now.`.\n\n## Data fields\n\n- `chars`: how many characters, spaces left out, the page has under covers.\n- `regions`: how many separate covered passages the page has: one per box over a run of words.\n\nThe `location` has the page's `pageIndex`. The warning never holds the covered text.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0030](../decisions/0030-extraction-output-and-model-plugins.md) §4: hidden text and the `covered` flag\n- [ADR 0031](../decisions/0031-cli-and-mcp-contract.md) §8: what `laminapdf check` reports\n- [T2b](../todos/done/T2b-check-failed-redactions.md): the warning\n",
|
|
144
|
+
"redaction-not-applied": "# `redaction-not-applied`\n\n- Type: warning\n- Kind: `security` (encryption, permissions or signatures block the call, or look tampered with)\n\n## What happened\n\nA page has redaction marks (`Redact` annotations, ISO 32000-2 §12.5.6.23) that were never applied. A mark only records what someone meant to remove; until a tool applies it, the text, images and drawings under it are all still in the file.\n\n## Why\n\nEditors such as Acrobat redact in two steps: you mark what to remove, then you apply the marks. A file saved between the two steps looks redacted in some viewers, which draw the mark's overlay, but nothing has been taken out.\n\n## How to fix\n\nApply the redactions in a tool that removes what they cover, then save the file as a full rewrite.\n\n## Example\n\nA page with two redaction marks over a name and an account number, saved before \"Apply redactions\" was chosen. `laminapdf check` reports `redaction-not-applied` for that page with `annotations` 2.\n\n## Data fields\n\n- `annotations`: how many redaction marks the page has.\n\nThe `location` has the page's `pageIndex`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0031](../decisions/0031-cli-and-mcp-contract.md) §8: what `laminapdf check` reports\n- [T2b](../todos/done/T2b-check-failed-redactions.md): the warning\n",
|
|
145
|
+
"text-in-earlier-revision": "# `text-in-earlier-revision`\n\n- Type: warning\n- Kind: `security` (encryption, permissions or signatures block the call, or look tampered with)\n\n## What happened\n\nThe file was saved with incremental updates, and an earlier revision holds words that the latest revision has nowhere. Anyone can cut the file back to that revision and read them.\n\n## Why\n\nAn incremental save appends the changes to the end of the file and keeps everything before them (ISO 32000-2 §7.5.6). Deleting a paragraph and saving that way leaves the paragraph in the bytes of the earlier revision. Signing, filling a form and some editors' plain \"Save\" all save incrementally.\n\nNot every removed word is a leak: fixing a typo removes the misspelt word too. The warning states that the earlier text is still in the file; whether that matters depends on what was removed.\n\n## How to fix\n\nSave the file as a full rewrite, which keeps only the latest revision. A signed file loses its signatures that way, so sign it again afterwards.\n\n## Example\n\n`fixtures/corpus/hello-incremental.pdf` first draws \"Hello, World\", and its update replaces that with \"Hello, Update\". `laminapdf check` reports `text-in-earlier-revision` with `revision` 0, `words` 1 and `pages` `[0]`.\n\n## Data fields\n\n- `revision`: the earlier revision's index, 0 for the original file.\n- `words`: how many words that revision has more often than the latest one (only words of two or more letters or digits count).\n- `pages`: the indices of that revision's pages where those words are.\n\nThe warning has no `location`, and it never holds the words themselves.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0031](../decisions/0031-cli-and-mcp-contract.md) §8: what `laminapdf check` reports\n- [T2b](../todos/done/T2b-check-failed-redactions.md): the warning and how revisions are compared\n",
|
|
129
146
|
"builder-finished": "# `builder-finished`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\nA `WasmBuilder` method was called after the builder's `finish`, or a `WasmPageBuilder` was drawn on or finished again after its own `finish` (or after its builder's).\n\n## Why\n\n`finish` hands the work over: a builder's becomes a `WasmDocument`, a page's is written into its builder. Neither holds anything to draw on afterwards.\n\n## How to fix\n\nDraw everything on a page before finishing it, and finish every page before the builder. To build more, create a new page or builder.\n\n## Example\n\n```js\nconst b = new WasmBuilder(undefined);\nconst page = b.page(595, 842);\npage.finish();\npage.save(); // throws { code: \"builder-finished\", … }\n```\n\n## Data fields\n\n- `argument`: always `builder`.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §7: the binding owns its pages\n",
|
|
130
147
|
"disposed": "# `disposed`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\nA `Document`, `Builder` or other handle of `@laminapdf/sdk` was used after `free()` released it, or after the `using` block that held it ended (`Symbol.dispose`). A page or save job is freed with its document, and a builder's page with its builder.\n\n## Why\n\nEach handle owns memory inside the WebAssembly module. Freeing it returns that memory at once, so the handle has nothing left to work on.\n\n## How to fix\n\nFree a handle only after its last use. To keep working with the document, open it again from its bytes, or create a new builder.\n\n## Example\n\n```ts\nconst doc = Document.open(bytes);\ndoc.free();\ndoc.save(); // throws LaminaPdfError { code: \"disposed\", … }\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [L2b](../todos/done/L2b-disposal-and-memory.md): the check on every handle, and on the pages and save jobs of `@laminapdf/wasm`\n",
|
|
131
148
|
"invalid-argument": "# `invalid-argument`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nA value passed from JavaScript to `@laminapdf/wasm` is not of the type its declaration describes. It might be a record with a field of the wrong type, or a string that names no known value (a blend mode, a fill rule, a standard 14 font, an op). It might also be a flat-encoded path cut short, a colour with the wrong number of components, or an ID that isn't 32 hex digits.\n\n## Why\n\nThe `.d.ts` types describe each argument, but JavaScript (and code written without the types) can pass anything. The binding checks each value as it converts it.\n\n## How to fix\n\nPass what the declaration says. When the value names an unknown string, `didYouMean` lists the closest allowed ones; `data.detail` says what the conversion found.\n\n## Example\n\n```js\npage.blendMode(\"multiplly\"); // throws { code: \"invalid-argument\", didYouMean: [\"multiply\"], … }\n```\n\n## Data fields\n\n- `argument`: the parameter that was wrong (`options`, `path`, `mode`, …).\n- `detail`: what the conversion said (untrusted: it may quote the value passed).\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §7\n- [ADR 0028](../decisions/0028-facade-rules-jobs-and-cancellation.md) F6\n",
|
|
@@ -133,7 +150,7 @@ export const PAGES = {
|
|
|
133
150
|
"unknown-option": "# `unknown-option`\n\n- Type: error\n- Kind: `usage` (the caller misused the API)\n\n## What happened\n\nAn options record passed to `@laminapdf/wasm` (`OpenOptionsInit`, `SaveOptionsInit`, `BuildOptionsInit`, …) has a key Lamina PDF doesn't know.\n\n## Why\n\nRecords refuse unknown keys instead of ignoring them, so a misspelt option fails loudly rather than silently doing nothing.\n\n## How to fix\n\nRemove the key or correct its spelling. `didYouMean` lists the known keys within two edits of it.\n\n## Example\n\n```js\nWasmDocument.openBytes(bytes, { pasword: \"secret\" }); // throws { code: \"unknown-option\", didYouMean: [\"password\"], … }\n```\n\n## Data fields\n\n- `argument`: the parameter whose record had the key (`options`, `metadata`, …).\n- `option`: the key given (untrusted: caller text, never in the message).\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0028](../decisions/0028-facade-rules-jobs-and-cancellation.md) F6\n- [ADR 0026](../decisions/0026-error-and-diagnostic-contract.md) §1\n",
|
|
134
151
|
"already-initialized": "# `already-initialized`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\n`init()` or `loadText()` of `@laminapdf/sdk` named a source (a URL, `Response`, bytes or `WebAssembly.Module`) for a module that an earlier call had already loaded, or started loading, from another source (or from the default file).\n\n## Why\n\nEach module is instantiated once per JavaScript realm: every document and builder lives in that instance. Loading a second copy from another source would leave two instances whose objects can't be mixed, so the second source is refused rather than silently ignored.\n\n## How to fix\n\nPass the source on the first call only; later calls (from other parts of the app) can call `init()` without one, which waits for the same load. Calling again with the very same source object is allowed.\n\n## Example\n\n```js\nawait init(new URL(\"/wasm/lamina_pdf_base.wasm\", location.href));\nawait init(); // fine: the module is loaded\nawait init(otherBytes); // throws { code: \"already-initialized\", … }\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §3\n",
|
|
135
152
|
"extract-module-not-loaded": "# `extract-module-not-loaded`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\n`page.text()` of `@laminapdf/sdk` was called on a page of a document opened in the base module, which has no text extraction.\n\n## Why\n\n`@laminapdf/sdk` ships three WebAssembly modules: base (open, read, edit, save), extract (base plus text extraction) and text (base plus fonts, shaping and extraction). A document lives in the module it was opened in, and opening uses the richest one loaded at that moment: text, then extract, then base. A document opened before the extract or text module was loaded stays in the base module.\n\n## How to fix\n\nLoad the extract module (about half the size of the text module) before opening the document: `await init({ extract: true })` or `await loadExtract()`. A document already open in the base module can be moved by saving it and opening the bytes again.\n\n## Example\n\n```js\nawait init();\nconst doc = Document.open(bytes);\ndoc.page(0).text(); // throws { code: \"extract-module-not-loaded\", … }\n\nawait loadExtract();\nDocument.open(bytes).page(0).text().text(); // works\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §4\n",
|
|
136
|
-
"fetch-failed": "# `fetch-failed`\n\n- Type: error\n- Kind: `io` (the host failed to supply bytes; often transient)\n\n## What happened\n\nA range source of `@laminapdf/sdk` (`httpRangeSource`) couldn't get bytes it asked for. The request failed (a network error, a CORS refusal, DNS), or the server answered with a status other than `200` or `206`, or with a `206` whose `Content-Range` (or length) doesn't match the range asked for. A `Content-Range` that the browser hides, because CORS doesn't expose it, looks the same. It is also raised when a `callbackSource`'s read returns a different number of bytes than it was asked for.\n\n## Why\n\nOpening a remote file range by range depends on the server: it must allow the `Range` request
|
|
153
|
+
"fetch-failed": "# `fetch-failed`\n\n- Type: error\n- Kind: `io` (the host failed to supply bytes; often transient)\n\n## What happened\n\nA range source of `@laminapdf/sdk` (`httpRangeSource`) couldn't get bytes it asked for. The request failed (a network error, a CORS refusal, DNS), or the server answered with a status other than `200` or `206`, or with a `206` whose `Content-Range` (or length) doesn't match the range asked for. A `Content-Range` that the browser hides, because CORS doesn't expose it, looks the same. It is also raised when a `callbackSource`'s read returns a different number of bytes than it was asked for.\n\n## Why\n\nOpening a remote file range by range depends on the server: it must allow the `Range` request and must not compress the response (`Content-Encoding` breaks byte ranges). Across origins, it must also allow the `If-Range` header that every request after the first carries, and expose `Content-Range`, `Content-Length` and `ETag` through CORS. Lamina PDF never retries on its own; the error says the bytes are not available.\n\n## How to fix\n\nCheck that the URL is reachable from where the code runs and that the server sends `Access-Control-Allow-Origin`, `Access-Control-Allow-Headers: Range, If-Range` and `Access-Control-Expose-Headers: Content-Range, Content-Length, ETag`. Serve PDFs without `Content-Encoding`. Retry the call yourself if the failure was transient.\n\n## Example\n\n```js\nconst doc = await Document.openRange(httpRangeSource(url)); // throws { code: \"fetch-failed\", data: { status: 403 } }\n```\n\n## Data fields\n\n- `reason`: `network`, `status`, `content-range` or `length` (Lamina PDF's own words). The URL is never included.\n- `status`: the HTTP status, when there was a response.\n- `expected`, `got`: for `length`, the bytes asked for and the bytes returned.\n",
|
|
137
154
|
"not-initialized": "# `not-initialized`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\nA function or class of `@laminapdf/sdk` (`Document.open`, `new Builder`, …) was called before `init()` had finished loading and instantiating the WebAssembly module.\n\n## Why\n\n`@laminapdf/sdk` is synchronous after `init()`, but fetching and compiling the `.wasm` file is asynchronous, so it happens once, up front, in `init()`. Until that promise resolves there is no module to call.\n\n## How to fix\n\nAwait `init()` once, before the first call; calling it again is cheap (it is idempotent). In a Cloudflare Worker, pass the imported module: `await init({ module: wasm })`.\n\n## Example\n\n```js\nimport { Document, init } from \"@laminapdf/sdk\";\nDocument.open(bytes); // throws { code: \"not-initialized\", … }\nawait init();\nDocument.open(bytes); // works\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §3\n",
|
|
138
155
|
"source-changed": "# `source-changed`\n\n- Type: error\n- Kind: `io` (the host failed to supply bytes; often transient)\n\n## What happened\n\nA remote file changed while `@laminapdf/sdk` was reading it range by range: a response's `ETag` or total length differs from the first one (or the server ignored `If-Range` and sent a different file).\n\n## Why\n\nA range document is assembled from many responses. If the file changed between them, the parts no longer belong to one file, and the document would read a mix of two versions. `httpRangeSource` sends `If-Range` with the first `ETag` and compares each response's `ETag` and `Content-Range` length with the first.\n\n## How to fix\n\nOpen the file again (a new source, a new document). If the file changes often, download it whole with `Document.open(bytes)` instead.\n\n## Example\n\n```js\nconst doc = await Document.openRange(httpRangeSource(url));\nawait doc.ensure(() => doc.pages); // throws { code: \"source-changed\", … } if the file was replaced meanwhile\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [L2c](../todos/done/L2c-range-byte-source.md): the range byte source\n",
|
|
139
156
|
"text-module-not-loaded": "# `text-module-not-loaded`\n\n- Type: error\n- Kind: `state` (the call isn't valid in the object's current state)\n\n## What happened\n\nA font or text method (`Font` use, `surface.text`, `surface.textBox`, `builder.font`) was called on a `Builder` created while only the base WebAssembly module was loaded, or `new Builder({ text: true })` was called before the text module was loaded.\n\n## Why\n\n`@laminapdf/sdk` ships two modules: the base module (open, edit, save, vector and image pages) and the larger text module (all of the base plus fonts, shaping and text layout). A document that draws text is built entirely in the text module, and loading it is asynchronous, so it can't happen inside a synchronous drawing call. A builder created without the text module can't gain it later.\n\n## How to fix\n\nLoad the text module before creating the builder that draws text: `await init({ text: true })`, or `await loadText()` after `init()`. Builders created after that use the text module.\n\n## Example\n\n```js\nawait init();\nconst b = new Builder();\nb.page(\"A4\").surface().text(\"Hi\", { font: Font.standard(\"Helvetica\"), size: 12, at: [72, 72] });\n// throws { code: \"text-module-not-loaded\", … }\nawait loadText(); // then create a new Builder\n```\n\n## Data fields\n\nNone.\n\n## For contributors\n\nThe decisions and todos behind this code:\n\n- [ADR 0016](../decisions/0016-package-design.md) §4\n",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../src/generated/explain.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,6FAA6F;AAC7F,qFAAqF;AAIrF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,KAAK,GAAwD;IACxE,gBAAgB,EAAE,o8BAAo8B;IACt9B,eAAe,EAAE,u8BAAu8B;IACx9B,iBAAiB,EAAE,8yBAA8yB;IACj0B,yBAAyB,EAAE,0pBAA0pB;IACrrB,kBAAkB,EAAE,6sBAA6sB;IACjuB,wBAAwB,EAAE,myBAAmyB;IAC7zB,qBAAqB,EAAE,ulBAAulB;IAC9mB,iBAAiB,EAAE,iqBAAiqB;IACprB,uBAAuB,EAAE,6nBAA6nB;IACtpB,4BAA4B,EAAE,mmBAAmmB;IACjoB,qBAAqB,EAAE,qxBAAqxB;IAC5yB,gBAAgB,EAAE,gnBAAgnB;IACloB,oBAAoB,EAAE,itBAAitB;IACvuB,aAAa,EAAE,6yBAA6yB;IAC5zB,gBAAgB,EAAE,0kBAA0kB;IAC5lB,wBAAwB,EAAE,oqBAAoqB;IAC9rB,eAAe,EAAE,sgBAAsgB;IACvhB,sBAAsB,EAAE,wkBAAwkB;IAChmB,cAAc,EAAE,kkBAAkkB;IACllB,oBAAoB,EAAE,8oBAA8oB;IACpqB,eAAe,EAAE,yoBAAyoB;IAC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,cAAc,EAAE,k1DAAk1D;IACl2D,uBAAuB,EAAE,wzCAAwzC;IACj1C,0BAA0B,EAAE,o2DAAo2D;IACh4D,kBAAkB,EAAE,s+BAAs+B;IAC1/B,UAAU,EAAE,mhCAAmhC;IAC/hC,kBAAkB,EAAE,s0CAAs0C;IAC11C,wBAAwB,EAAE,gzCAAgzC;IAC10C,gBAAgB,EAAE,2hCAA2hC;IAC7iC,qBAAqB,EAAE,qtCAAqtC;IAC5uC,2BAA2B,EAAE,+yCAA+yC;IAC50C,cAAc,EAAE,gyDAAgyD;IAChzD,iBAAiB,EAAE,giCAAgiC;IACnjC,gBAAgB,EAAE,0pCAA0pC;IAC5qC,wBAAwB,EAAE,44CAA44C;IACt6C,yBAAyB,EAAE,y0CAAy0C;IACp2C,gBAAgB,EAAE,67CAA67C;IAC/8C,eAAe,EAAE,uoCAAuoC;IACxpC,WAAW,EAAE,8zCAA8zC;IAC30C,eAAe,EAAE,q8DAAq8D;IACt9D,gBAAgB,EAAE,8nCAA8nC;IAChpC,sBAAsB,EAAE,2lDAA2lD;IACnnD,oBAAoB,EAAE,iwCAAiwC;IACvxC,2BAA2B,EAAE,4/BAA4/B;IACzhC,cAAc,EAAE,k8BAAk8B;IACl9B,mBAAmB,EAAE,qvCAAqvC;IAC1wC,kBAAkB,EAAE,koCAAkoC;IACtpC,mBAAmB,EAAE,2zCAA2zC;IACh1C,oBAAoB,EAAE,yhDAAyhD;CAChjD,CAAC"}
|
|
@@ -48,7 +48,7 @@ export type Coordinates = {
|
|
|
48
48
|
userUnit: number;
|
|
49
49
|
};
|
|
50
50
|
/** Why text was left out. */
|
|
51
|
-
export type DropReason = "invisible" | "off-page" | "tiny" | "clipped" | "low-contrast" | "artifact" | "running-header" | "running-footer" | "page-number";
|
|
51
|
+
export type DropReason = "invisible" | "off-page" | "tiny" | "clipped" | "low-contrast" | "covered" | "artifact" | "running-header" | "running-footer" | "page-number";
|
|
52
52
|
/**
|
|
53
53
|
* Text left out of the output ([ADR 0030] §4). It records a count, never the text, so a log of
|
|
54
54
|
* the output can't leak what was hidden.
|
|
@@ -86,6 +86,8 @@ export type ExtractedPage = {
|
|
|
86
86
|
label?: string | null;
|
|
87
87
|
/** 1-based, as people count. */
|
|
88
88
|
number: number;
|
|
89
|
+
/** Whether the page's text is the page's text, and the measures that decided it. */
|
|
90
|
+
textLayer: TextLayer;
|
|
89
91
|
/** The displayed width in points (after `/Rotate` and `/UserUnit`). */
|
|
90
92
|
width: number;
|
|
91
93
|
};
|
|
@@ -107,9 +109,10 @@ export type ExtractedSource = {
|
|
|
107
109
|
export type Flags = DropReason[];
|
|
108
110
|
/** Who made the extraction (ADR 0030 §1's `generator`). */
|
|
109
111
|
export type Generator = {
|
|
110
|
-
/** `"rules"`, or `"rules+models"`
|
|
112
|
+
/** `"rules"`, or `"rules+models"` when a model plug-in was used. */
|
|
111
113
|
mode: string;
|
|
112
|
-
|
|
114
|
+
/** Each model used: name, version, weights' SHA-256 and licence. */
|
|
115
|
+
models: ModelInfo[];
|
|
113
116
|
name: string;
|
|
114
117
|
version: string;
|
|
115
118
|
};
|
|
@@ -126,6 +129,10 @@ export type JsonBlock = {
|
|
|
126
129
|
cells?: Cell[];
|
|
127
130
|
/** In [0, 1]: 1 for structure from the tree, lower for structure inferred from layout. */
|
|
128
131
|
confidence: number;
|
|
132
|
+
/** For a table that goes on over the page break: the ID of the part on the next page. */
|
|
133
|
+
continuedBy?: string | null;
|
|
134
|
+
/** For a table that goes on from the page before: the ID of the part it continues. */
|
|
135
|
+
continues?: string | null;
|
|
129
136
|
/** `p<page index>-b<position in the page's reading order>`. */
|
|
130
137
|
id: string;
|
|
131
138
|
/** The page index. */
|
|
@@ -166,6 +173,17 @@ export type JsonBlock = {
|
|
|
166
173
|
rows: number;
|
|
167
174
|
type: "table";
|
|
168
175
|
});
|
|
176
|
+
/** Which model made a result, as the output's `generator.models` records it. */
|
|
177
|
+
export type ModelInfo = {
|
|
178
|
+
/** The SPDX licence of its weights. */
|
|
179
|
+
licence: string;
|
|
180
|
+
/** Its name, e.g. `docling-layout-heron`. */
|
|
181
|
+
name: string;
|
|
182
|
+
/** The SHA-256 of its weights, in lowercase hex. */
|
|
183
|
+
sha256: string;
|
|
184
|
+
/** Its version or revision. */
|
|
185
|
+
version: string;
|
|
186
|
+
};
|
|
169
187
|
/** A chunk's area on one page. */
|
|
170
188
|
export type Region = {
|
|
171
189
|
/** The union of the chunk's blocks' boxes on that page, in page space. */
|
|
@@ -183,6 +201,13 @@ export type Span = {
|
|
|
183
201
|
flags: Flags;
|
|
184
202
|
/** The font's `/BaseFont`. */
|
|
185
203
|
font: string;
|
|
204
|
+
/**
|
|
205
|
+
* The OCR engine's confidence, 0 to 1, when an engine read this text from the page image
|
|
206
|
+
* rather than the file's text layer ([ADR 0030] §6); absent for the text layer's runs.
|
|
207
|
+
*
|
|
208
|
+
* [ADR 0030]: https://github.com/laudebugs/laminapdf/blob/main/docs/decisions/0030-extraction-output-and-model-plugins.md
|
|
209
|
+
*/
|
|
210
|
+
ocr?: number | null;
|
|
186
211
|
/** The glyph size in points. */
|
|
187
212
|
size: number;
|
|
188
213
|
/** The run's text. */
|
|
@@ -209,6 +234,28 @@ export type StructRef = {
|
|
|
209
234
|
export type StructSource = "tagged" | "xycut" | "content";
|
|
210
235
|
/** What found a table. */
|
|
211
236
|
export type TableDetector = "lattice" | "stream" | "tagged";
|
|
237
|
+
/**
|
|
238
|
+
* What a page's text layer is: whether its extracted text is the page's text, or the page
|
|
239
|
+
* needs OCR. The measures let a pipeline apply its own cut-offs.
|
|
240
|
+
*/
|
|
241
|
+
export type TextLayer = {
|
|
242
|
+
/** Visible characters (spaces left out) in runs that aren't invisible, off the page or tiny. */
|
|
243
|
+
chars: number;
|
|
244
|
+
/** The share of the page the images cover, measured on a 32 × 32 grid. */
|
|
245
|
+
imageShare: number;
|
|
246
|
+
/** How many images the page draws, in its forms too. */
|
|
247
|
+
images: number;
|
|
248
|
+
/** Characters drawn invisibly (text rendering mode 3 or 7), such as an OCR layer. */
|
|
249
|
+
invisibleChars: number;
|
|
250
|
+
/** How many paths the page paints (fills and strokes). */
|
|
251
|
+
paths: number;
|
|
252
|
+
/** The verdict. */
|
|
253
|
+
status: TextLayerStatus;
|
|
254
|
+
/** The share of the visible runs' glyphs that map to no Unicode; 0 with no visible glyphs. */
|
|
255
|
+
unmappedShare: number;
|
|
256
|
+
};
|
|
257
|
+
/** A page's text-layer status, the first that applies. */
|
|
258
|
+
export type TextLayerStatus = "empty" | "ocr-layer" | "needs-ocr" | "mixed" | "native";
|
|
212
259
|
/**
|
|
213
260
|
* Where a piece of text sits in a rendering, in Unicode scalar values (`char`s), `start`
|
|
214
261
|
* inclusive and `end` exclusive. Code points, not bytes or UTF-16 units, so Python slices a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/generated/extract.ts"],"names":[],"mappings":"AAGA,iCAAiC;AACjC,MAAM,MAAM,IAAI,GAAG;IACjB,6BAA6B;IAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,iBAAiB;AACjB,MAAM,MAAM,KAAK,GAAG;IAClB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,KAAK,EAAE,MAAM,EAAE,CAAC;I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M,EAAE,eAAe,CAAC;IACxB,8FAA8F;IAC9F,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvF;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC"}
|
package/dist/source/http.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface HttpRangeOptions {
|
|
|
23
23
|
* with `source-changed`. A server that ignores
|
|
24
24
|
* `Range` (it answers `200`) is read with that one full download.
|
|
25
25
|
*
|
|
26
|
-
* The server must allow `Range` (across origins: `Access-Control-Allow-Headers: Range` and
|
|
26
|
+
* The server must allow `Range` (across origins: `Access-Control-Allow-Headers: Range, If-Range` and
|
|
27
27
|
* `Access-Control-Expose-Headers: Content-Range, Content-Length, ETag`) and must not compress
|
|
28
28
|
* the response.
|
|
29
29
|
*
|
package/dist/source/http.js
CHANGED
|
@@ -28,7 +28,7 @@ function changed() {
|
|
|
28
28
|
* with `source-changed`. A server that ignores
|
|
29
29
|
* `Range` (it answers `200`) is read with that one full download.
|
|
30
30
|
*
|
|
31
|
-
* The server must allow `Range` (across origins: `Access-Control-Allow-Headers: Range` and
|
|
31
|
+
* The server must allow `Range` (across origins: `Access-Control-Allow-Headers: Range, If-Range` and
|
|
32
32
|
* `Access-Control-Expose-Headers: Content-Range, Content-Length, ETag`) and must not compress
|
|
33
33
|
* the response.
|
|
34
34
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AfRelationshipInit, AlignInit, AttachmentInit, BuildOptionsInit, DirectionInit, DocumentInfoJs, EditedJs, FitInit, LimitsInit, LineBoxJs, LinkTargetInit, MetadataInit, Op as OpJs, OutlineEntryInit, OverflowInit, PageInfoJs, PageLabelInit, ProfileInit, ProgressJs, RectJs, RenderModeInit, SaveOptionsInit, SaveReportJs, TextLayoutJs, TextRunJs, UndoOutcomeJs, ViewerPreferencesInit } from "@laminapdf/wasm/text";
|
|
1
|
+
import type { AfRelationshipInit, AlignInit, AttachmentInit, BuildOptionsInit, DirectionInit, DocumentInfoJs, EditedJs, FitInit, LimitsInit, LineBoxJs, LinkTargetInit, MetadataInit, Op as OpJs, OutlineEntryInit, OutlineNodeJs, OverflowInit, PageInfoJs, PageLabelInit, ProfileInit, ProgressJs, RectJs, RenderModeInit, SaveOptionsInit, SaveReportJs, StructureKidJs, StructureNodeJs, TargetJs, TargetViewJs, TextLayoutJs, TextRunJs, UndoOutcomeJs, ViewerPreferencesInit } from "@laminapdf/wasm/text";
|
|
2
2
|
/** An edit (ADR 0006 §6: `{ op: "setInfo" | "rotatePage", args }`), as in `fixtures/ops/v1`. */
|
|
3
3
|
export type Op = OpJs;
|
|
4
4
|
/** An op log: `{ v: 1, ops }`. */
|
|
@@ -25,6 +25,13 @@ export type SaveReport = SaveReportJs;
|
|
|
25
25
|
export type PageInfo = PageInfoJs;
|
|
26
26
|
/** The Info dictionary's text entries (document text). */
|
|
27
27
|
export type DocumentInfo = DocumentInfoJs;
|
|
28
|
+
/**
|
|
29
|
+
* An element of a tagged document's structure tree: its standard type (`H1`, `P`, `LI`,
|
|
30
|
+
* `Figure` …), alternate text, language, actual text, and kids in reading order (document text).
|
|
31
|
+
*/
|
|
32
|
+
export type StructureNode = StructureNodeJs;
|
|
33
|
+
/** A kid of a {@link StructureNode}: an element, or marked content `mcid` on page `page`. */
|
|
34
|
+
export type StructureKid = StructureKidJs;
|
|
28
35
|
/** The pages an edit touched. */
|
|
29
36
|
export type Edited = EditedJs;
|
|
30
37
|
/** How an undo or redo went. */
|
|
@@ -45,6 +52,17 @@ export type LinkTarget = LinkTargetInit;
|
|
|
45
52
|
export type Fit = FitInit;
|
|
46
53
|
/** An outline (bookmarks) item with its children. */
|
|
47
54
|
export type OutlineEntry = OutlineEntryInit;
|
|
55
|
+
/** One item of a document's outline (its bookmarks), with where it goes and its children. */
|
|
56
|
+
export type OutlineNode = OutlineNodeJs;
|
|
57
|
+
/** A place in a document: a 0-based page index and how to show it. */
|
|
58
|
+
export type Target = TargetJs;
|
|
59
|
+
/**
|
|
60
|
+
* How a {@link Target} shows its page, in page space (points from the displayed page's top-left,
|
|
61
|
+
* y down), by `kind`: `"at"` puts (`x`, `y`) at the viewport's top-left at `zoom`, `"fit"` fits
|
|
62
|
+
* the page, `"fit-width"` its width from `y`, `"fit-height"` its height from `x`, `"fit-rect"` the
|
|
63
|
+
* rectangle. A coordinate the file leaves unset is absent: keep the current one.
|
|
64
|
+
*/
|
|
65
|
+
export type TargetView = TargetViewJs;
|
|
48
66
|
/** A page-label range, by its first page. */
|
|
49
67
|
export type PageLabel = PageLabelInit;
|
|
50
68
|
/** The document's metadata (Info and XMP). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,E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C;AAC9C,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AACpC,wCAAwC;AACxC,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AACtD,wDAAwD;AACxD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,gCAAgC;AAChC,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AACpC,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AACtC,4BAA4B;AAC5B,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC;AAChC,oCAAoC;AACpC,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC;AAC9B,2BAA2B;AAC3B,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AACtC,wDAAwD;AACxD,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AACpC,2BAA2B;AAC3B,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AAExC;;;GAGG;AACH,MAAM,MAAM,KAAK,GACb,MAAM,GACN,SAAS,CAAC,MAAM,CAAC,GACjB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GACjC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9C,gGAAgG;AAChG,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AACpD,2DAA2D;AAC3D,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
// must be one build. `cargo xtask version sync` writes it from package.json (ADR 0017), and
|
|
3
3
|
// test/version.test.ts checks the two agree.
|
|
4
4
|
/** `@laminapdf/sdk`'s version. */
|
|
5
|
-
export const VERSION = "0.2.0-alpha.
|
|
5
|
+
export const VERSION = "0.2.0-alpha.4";
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/dist/worker/support.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ import type { Document, PageRef } from "../document.js";
|
|
|
4
4
|
* - `transact` takes a callback, which can't cross to a worker: use `apply` with ops;
|
|
5
5
|
* - `saveJob` returns a job the caller steps: the remote `save`/`saveWithReport` are stepped
|
|
6
6
|
* jobs already, cancelled through `signal`;
|
|
7
|
+
* - `extractJob` returns a job whose model results the caller provides between steps: run the
|
|
8
|
+
* model in the worker's own context, or extract on the main thread;
|
|
7
9
|
* - `ensure` fetches a range document's bytes: the worker does that for every call;
|
|
8
10
|
* - `free` and `Symbol.dispose`: the remote handle's `close()` and `Symbol.asyncDispose`.
|
|
9
11
|
*/
|
|
10
|
-
export type ExcludedDocumentMembers = "transact" | "saveJob" | "ensure" | "free" | typeof Symbol.dispose;
|
|
12
|
+
export type ExcludedDocumentMembers = "transact" | "saveJob" | "extractJob" | "ensure" | "free" | typeof Symbol.dispose;
|
|
11
13
|
/**
|
|
12
14
|
* PageRef members with no remote twin: `free` and `Symbol.dispose`, since the worker frees a page
|
|
13
15
|
* with its document.
|
|
@@ -22,6 +24,9 @@ export declare const DOCUMENT_METHODS: {
|
|
|
22
24
|
readonly extract: 1;
|
|
23
25
|
readonly hasUnsavedChanges: 0;
|
|
24
26
|
readonly info: 0;
|
|
27
|
+
readonly isTagged: 0;
|
|
28
|
+
readonly namedDestination: 1;
|
|
29
|
+
readonly outline: 0;
|
|
25
30
|
readonly page: 1;
|
|
26
31
|
readonly pageById: 1;
|
|
27
32
|
readonly pageCount: 0;
|
|
@@ -31,6 +36,7 @@ export declare const DOCUMENT_METHODS: {
|
|
|
31
36
|
readonly redo: 0;
|
|
32
37
|
readonly save: 1;
|
|
33
38
|
readonly saveWithReport: 1;
|
|
39
|
+
readonly structureTree: 0;
|
|
34
40
|
readonly undo: 0;
|
|
35
41
|
readonly warnings: 0;
|
|
36
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/worker/support.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/worker/support.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,MAAM,CAAC,OAAO,CAAC;AAExH;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,MAAM,CAAC,OAAO,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,QAAQ,EAAE,uBAAuB,CAAC,CAAC;AACvF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,MAAM,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB;oBACpB,CAAC;uBACE,CAAC;6BACK,CAAC;sBACR,CAAC;gCACS,CAAC;mBACd,CAAC;uBACG,CAAC;+BACO,CAAC;sBACV,CAAC;mBACJ,CAAC;uBACG,CAAC;wBACA,CAAC;uBACF,CAAC;oBACJ,CAAC;qBACA,CAAC;mBACH,CAAC;mBACD,CAAC;6BACS,CAAC;4BACF,CAAC;mBACV,CAAC;uBACG,CAAC;CAC+C,CAAC;AAE7D,eAAO,MAAM,YAAY;iBACnB,CAAC;oBACE,CAAC;mBACF,CAAC;mBACD,CAAC;CAC+C,CAAC"}
|
package/dist/worker/support.js
CHANGED
|
@@ -5,6 +5,9 @@ export const DOCUMENT_METHODS = {
|
|
|
5
5
|
extract: 1,
|
|
6
6
|
hasUnsavedChanges: 0,
|
|
7
7
|
info: 0,
|
|
8
|
+
isTagged: 0,
|
|
9
|
+
namedDestination: 1,
|
|
10
|
+
outline: 0,
|
|
8
11
|
page: 1,
|
|
9
12
|
pageById: 1,
|
|
10
13
|
pageCount: 0,
|
|
@@ -14,6 +17,7 @@ export const DOCUMENT_METHODS = {
|
|
|
14
17
|
redo: 0,
|
|
15
18
|
save: 1,
|
|
16
19
|
saveWithReport: 1,
|
|
20
|
+
structureTree: 0,
|
|
17
21
|
undo: 0,
|
|
18
22
|
warnings: 0,
|
|
19
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/worker/support.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/worker/support.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,cAAc,EAAE,CAAC;IACjB,OAAO,EAAE,CAAC;IACV,iBAAiB,EAAE,CAAC;IACpB,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,gBAAgB,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;CAC+C,CAAC;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CAC+C,CAAC"}
|
package/docs/AGENTS.md
CHANGED