@laminapdf/sdk 0.2.0-alpha.3 → 0.2.0-alpha.5
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 +5 -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 +78 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +112 -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/reflow.d.ts +88 -0
- package/dist/reflow.d.ts.map +1 -0
- package/dist/reflow.js +4 -0
- package/dist/reflow.js.map +1 -0
- package/dist/source/http.d.ts +1 -1
- package/dist/source/http.js +1 -1
- package/dist/types.d.ts +35 -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 +10 -1
- package/dist/worker/support.d.ts.map +1 -1
- package/dist/worker/support.js +7 -0
- package/dist/worker/support.js.map +1 -1
- package/docs/AGENTS.md +1 -1
- package/docs/api/README.md +29 -1
- package/docs/api/classes/Builder.md +1 -1
- package/docs/api/classes/Document.md +186 -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/Reflow.md +61 -0
- package/docs/api/interfaces/ReflowChecks.md +69 -0
- 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/DocumentProperties.md +18 -0
- 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/PageImageReason.md +15 -0
- package/docs/api/type-aliases/PageInfo.md +1 -1
- package/docs/api/type-aliases/PageLabel.md +1 -1
- package/docs/api/type-aliases/PageLink.md +20 -0
- 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/ReflowBlock.md +44 -0
- package/docs/api/type-aliases/ReflowKind.md +15 -0
- package/docs/api/type-aliases/ReflowRefusal.md +16 -0
- package/docs/api/type-aliases/ReflowSource.md +15 -0
- 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 +77 -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 +5 -3
- package/schemas/error.schema.json +18 -1
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, PageLinkJs, ProfileInit, ProgressJs, PropertiesJs, 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,33 @@ 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
|
+
/**
|
|
58
|
+
* One link on a page, in page space: its `rect` (`[x0, y0, x1, y1]`), the `quads` that follow it
|
|
59
|
+
* when the file gives them (eight numbers per area), its `contents` (a description), and what it
|
|
60
|
+
* does by `kind`: `"dest"` and `"named"` go to a `target` in this document (absent when it names
|
|
61
|
+
* no page here), `"uri"` to a `uri` as the file stores it, `"remote"` to another `file`,
|
|
62
|
+
* `"named-action"` runs a named action (`NextPage`, `PrevPage`, `FirstPage`, `LastPage`), and
|
|
63
|
+
* `"unsupported"` names an `action` a reader never runs (`Launch`, `JavaScript`…).
|
|
64
|
+
*/
|
|
65
|
+
export type PageLink = PageLinkJs;
|
|
66
|
+
/**
|
|
67
|
+
* What a properties view shows about a document: its Info entries and dates (ISO 8601), the
|
|
68
|
+
* XMP packet's text, version, pages, file size, linearization and tagging, its `encryption`
|
|
69
|
+
* (with the author's `permissions`, a request rather than a lock), the `fonts` its pages use,
|
|
70
|
+
* the `signatures` present (not verified) and what it `contains` besides its pages.
|
|
71
|
+
*/
|
|
72
|
+
export type DocumentProperties = PropertiesJs;
|
|
73
|
+
/** A place in a document: a 0-based page index and how to show it. */
|
|
74
|
+
export type Target = TargetJs;
|
|
75
|
+
/**
|
|
76
|
+
* How a {@link Target} shows its page, in page space (points from the displayed page's top-left,
|
|
77
|
+
* y down), by `kind`: `"at"` puts (`x`, `y`) at the viewport's top-left at `zoom`, `"fit"` fits
|
|
78
|
+
* the page, `"fit-width"` its width from `y`, `"fit-height"` its height from `x`, `"fit-rect"` the
|
|
79
|
+
* rectangle. A coordinate the file leaves unset is absent: keep the current one.
|
|
80
|
+
*/
|
|
81
|
+
export type TargetView = TargetViewJs;
|
|
48
82
|
/** A page-label range, by its first page. */
|
|
49
83
|
export type PageLabel = PageLabelInit;
|
|
50
84
|
/** 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,EAAE,IAAI,IAAI,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,gGAAgG;AAChG,MAAM,MAAM,EAAE,GAAG,IAAI,CAAC;AACtB,kCAAkC;AAClC,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC;CAC7B;AACD,mEAAmE;AACnE,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAChC,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,gD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AS,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.5";
|
|
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,15 +24,22 @@ 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;
|
|
28
33
|
readonly pageInfo: 1;
|
|
34
|
+
readonly pageLinks: 1;
|
|
29
35
|
readonly pages: 0;
|
|
36
|
+
readonly properties: 0;
|
|
30
37
|
readonly rebase: 1;
|
|
31
38
|
readonly redo: 0;
|
|
39
|
+
readonly reflow: 0;
|
|
32
40
|
readonly save: 1;
|
|
33
41
|
readonly saveWithReport: 1;
|
|
42
|
+
readonly structureTree: 0;
|
|
34
43
|
readonly undo: 0;
|
|
35
44
|
readonly warnings: 0;
|
|
36
45
|
};
|
|
@@ -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;wBACA,CAAC;oBACL,CAAC;yBACI,CAAC;qBACL,CAAC;mBACH,CAAC;qBACC,CAAC;mBACH,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,15 +5,22 @@ 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,
|
|
11
14
|
pageInfo: 1,
|
|
15
|
+
pageLinks: 1,
|
|
12
16
|
pages: 0,
|
|
17
|
+
properties: 0,
|
|
13
18
|
rebase: 1,
|
|
14
19
|
redo: 0,
|
|
20
|
+
reflow: 0,
|
|
15
21
|
save: 1,
|
|
16
22
|
saveWithReport: 1,
|
|
23
|
+
structureTree: 0,
|
|
17
24
|
undo: 0,
|
|
18
25
|
warnings: 0,
|
|
19
26
|
};
|
|
@@ -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,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,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
package/docs/api/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "0.2.0-alpha.
|
|
2
|
+
version: "0.2.0-alpha.5"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
**@laminapdf/sdk**
|
|
@@ -12,6 +12,7 @@ version: "0.2.0-alpha.3"
|
|
|
12
12
|
|
|
13
13
|
- [Builder](classes/Builder.md)
|
|
14
14
|
- [Document](classes/Document.md)
|
|
15
|
+
- [ExtractJob](classes/ExtractJob.md)
|
|
15
16
|
- [Font](classes/Font.md)
|
|
16
17
|
- [Image](classes/Image.md)
|
|
17
18
|
- [LaminaPdfError](classes/LaminaPdfError.md)
|
|
@@ -33,10 +34,16 @@ version: "0.2.0-alpha.3"
|
|
|
33
34
|
- [ExtractOptions](interfaces/ExtractOptions.md)
|
|
34
35
|
- [ExtractResult](interfaces/ExtractResult.md)
|
|
35
36
|
- [FontInfo](interfaces/FontInfo.md)
|
|
37
|
+
- [HostModels](interfaces/HostModels.md)
|
|
36
38
|
- [HttpRangeOptions](interfaces/HttpRangeOptions.md)
|
|
37
39
|
- [InitOptions](interfaces/InitOptions.md)
|
|
40
|
+
- [LayoutRegion](interfaces/LayoutRegion.md)
|
|
38
41
|
- [Leak](interfaces/Leak.md)
|
|
39
42
|
- [Location](interfaces/Location.md)
|
|
43
|
+
- [ModelInfo](interfaces/ModelInfo.md)
|
|
44
|
+
- [ModelRequest](interfaces/ModelRequest.md)
|
|
45
|
+
- [Models](interfaces/Models.md)
|
|
46
|
+
- [OcrWord](interfaces/OcrWord.md)
|
|
40
47
|
- [OpenOptions](interfaces/OpenOptions.md)
|
|
41
48
|
- [OpLog](interfaces/OpLog.md)
|
|
42
49
|
- [PageTextOptions](interfaces/PageTextOptions.md)
|
|
@@ -44,6 +51,8 @@ version: "0.2.0-alpha.3"
|
|
|
44
51
|
- [QuadPoint](interfaces/QuadPoint.md)
|
|
45
52
|
- [RangeOptions](interfaces/RangeOptions.md)
|
|
46
53
|
- [RangeSource](interfaces/RangeSource.md)
|
|
54
|
+
- [Reflow](interfaces/Reflow.md)
|
|
55
|
+
- [ReflowChecks](interfaces/ReflowChecks.md)
|
|
47
56
|
- [StrokeStyle](interfaces/StrokeStyle.md)
|
|
48
57
|
- [TagSpec](interfaces/TagSpec.md)
|
|
49
58
|
- [TextBoxOptions](interfaces/TextBoxOptions.md)
|
|
@@ -66,6 +75,7 @@ version: "0.2.0-alpha.3"
|
|
|
66
75
|
- [Coordinates](type-aliases/Coordinates.md)
|
|
67
76
|
- [Direction](type-aliases/Direction.md)
|
|
68
77
|
- [DocumentInfo](type-aliases/DocumentInfo.md)
|
|
78
|
+
- [DocumentProperties](type-aliases/DocumentProperties.md)
|
|
69
79
|
- [Dropped](type-aliases/Dropped.md)
|
|
70
80
|
- [DropReason](type-aliases/DropReason.md)
|
|
71
81
|
- [Edited](type-aliases/Edited.md)
|
|
@@ -76,6 +86,8 @@ version: "0.2.0-alpha.3"
|
|
|
76
86
|
- [ExtractedSource](type-aliases/ExtractedSource.md)
|
|
77
87
|
- [ExtractFormat](type-aliases/ExtractFormat.md)
|
|
78
88
|
- [Extraction](type-aliases/Extraction.md)
|
|
89
|
+
- [ExtractJobOptions](type-aliases/ExtractJobOptions.md)
|
|
90
|
+
- [ExtractStep](type-aliases/ExtractStep.md)
|
|
79
91
|
- [FillRule](type-aliases/FillRule.md)
|
|
80
92
|
- [Fit](type-aliases/Fit.md)
|
|
81
93
|
- [Flags](type-aliases/Flags.md)
|
|
@@ -90,18 +102,27 @@ version: "0.2.0-alpha.3"
|
|
|
90
102
|
- [LineJoin](type-aliases/LineJoin.md)
|
|
91
103
|
- [LinkTarget](type-aliases/LinkTarget.md)
|
|
92
104
|
- [Metadata](type-aliases/Metadata.md)
|
|
105
|
+
- [ModelResult](type-aliases/ModelResult.md)
|
|
93
106
|
- [Op](type-aliases/Op.md)
|
|
94
107
|
- [OutlineEntry](type-aliases/OutlineEntry.md)
|
|
108
|
+
- [OutlineNode](type-aliases/OutlineNode.md)
|
|
95
109
|
- [Overflow](type-aliases/Overflow.md)
|
|
110
|
+
- [PageImageReason](type-aliases/PageImageReason.md)
|
|
96
111
|
- [PageInfo](type-aliases/PageInfo.md)
|
|
97
112
|
- [PageLabel](type-aliases/PageLabel.md)
|
|
113
|
+
- [PageLink](type-aliases/PageLink.md)
|
|
98
114
|
- [PageSizeName](type-aliases/PageSizeName.md)
|
|
99
115
|
- [Point](type-aliases/Point.md)
|
|
100
116
|
- [Profile](type-aliases/Profile.md)
|
|
101
117
|
- [Progress](type-aliases/Progress.md)
|
|
102
118
|
- [ReadingOrder](type-aliases/ReadingOrder.md)
|
|
103
119
|
- [Rect](type-aliases/Rect.md)
|
|
120
|
+
- [ReflowBlock](type-aliases/ReflowBlock.md)
|
|
121
|
+
- [ReflowKind](type-aliases/ReflowKind.md)
|
|
122
|
+
- [ReflowRefusal](type-aliases/ReflowRefusal.md)
|
|
123
|
+
- [ReflowSource](type-aliases/ReflowSource.md)
|
|
104
124
|
- [Region](type-aliases/Region.md)
|
|
125
|
+
- [RegionLabel](type-aliases/RegionLabel.md)
|
|
105
126
|
- [RenderMode](type-aliases/RenderMode.md)
|
|
106
127
|
- [Rotation](type-aliases/Rotation.md)
|
|
107
128
|
- [SaveOptions](type-aliases/SaveOptions.md)
|
|
@@ -111,11 +132,17 @@ version: "0.2.0-alpha.3"
|
|
|
111
132
|
- [Standard14](type-aliases/Standard14.md)
|
|
112
133
|
- [StructRef](type-aliases/StructRef.md)
|
|
113
134
|
- [StructSource](type-aliases/StructSource.md)
|
|
135
|
+
- [StructureKid](type-aliases/StructureKid.md)
|
|
136
|
+
- [StructureNode](type-aliases/StructureNode.md)
|
|
114
137
|
- [TableDetector](type-aliases/TableDetector.md)
|
|
115
138
|
- [TableMode](type-aliases/TableMode.md)
|
|
116
139
|
- [TableScope](type-aliases/TableScope.md)
|
|
117
140
|
- [Tag](type-aliases/Tag.md)
|
|
118
141
|
- [TagName](type-aliases/TagName.md)
|
|
142
|
+
- [Target](type-aliases/Target.md)
|
|
143
|
+
- [TargetView](type-aliases/TargetView.md)
|
|
144
|
+
- [TextLayer](type-aliases/TextLayer.md)
|
|
145
|
+
- [TextLayerStatus](type-aliases/TextLayerStatus.md)
|
|
119
146
|
- [TextLayout](type-aliases/TextLayout.md)
|
|
120
147
|
- [TextRange](type-aliases/TextRange.md)
|
|
121
148
|
- [TextRunInfo](type-aliases/TextRunInfo.md)
|
|
@@ -134,6 +161,7 @@ version: "0.2.0-alpha.3"
|
|
|
134
161
|
## Functions
|
|
135
162
|
|
|
136
163
|
- [callbackSource](functions/callbackSource.md)
|
|
164
|
+
- [extractWithModels](functions/extractWithModels.md)
|
|
137
165
|
- [httpRangeSource](functions/httpRangeSource.md)
|
|
138
166
|
- [init](functions/init.md)
|
|
139
167
|
- [isExtractLoaded](functions/isExtractLoaded.md)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: "0.2.0-alpha.
|
|
2
|
+
version: "0.2.0-alpha.5"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
[**@laminapdf/sdk**](../README.md)
|
|
@@ -112,6 +112,25 @@ Whether `free()` ran on this handle or its parent.
|
|
|
112
112
|
|
|
113
113
|
***
|
|
114
114
|
|
|
115
|
+
### isTagged
|
|
116
|
+
|
|
117
|
+
#### Get Signature
|
|
118
|
+
|
|
119
|
+
> **get** **isTagged**(): `boolean`
|
|
120
|
+
|
|
121
|
+
Whether the document says it is tagged (`/MarkInfo /Marked true`); it doesn't check the tree.
|
|
122
|
+
Needs a document opened while the extract or text module was loaded, as `page.text()` does.
|
|
123
|
+
|
|
124
|
+
##### Throws
|
|
125
|
+
|
|
126
|
+
[LaminaPdfError](LaminaPdfError.md) `extract-module-not-loaded`; reading errors.
|
|
127
|
+
|
|
128
|
+
##### Returns
|
|
129
|
+
|
|
130
|
+
`boolean`
|
|
131
|
+
|
|
132
|
+
***
|
|
133
|
+
|
|
115
134
|
### owned
|
|
116
135
|
|
|
117
136
|
#### Get Signature
|
|
@@ -386,6 +405,37 @@ const chunks = doc.extract({ format: "chunks", chunk: { maxTokens: 400 } });
|
|
|
386
405
|
|
|
387
406
|
***
|
|
388
407
|
|
|
408
|
+
### extractJob()
|
|
409
|
+
|
|
410
|
+
> **extractJob**\<`F`\>(`options`): [`ExtractJob`](ExtractJob.md)\<`F`\>
|
|
411
|
+
|
|
412
|
+
An extraction stepped a page at a time, for models the host runs: each step that needs a
|
|
413
|
+
model's result stops with a `request` (the page and resolution to render), answered with
|
|
414
|
+
[ExtractJob.provide](ExtractJob.md#provide). [extractWithModels](../functions/extractWithModels.md) loops one for async models. Needs a
|
|
415
|
+
document opened while the extract or text module was loaded.
|
|
416
|
+
|
|
417
|
+
#### Type Parameters
|
|
418
|
+
|
|
419
|
+
##### F
|
|
420
|
+
|
|
421
|
+
`F` *extends* [`ExtractFormat`](../type-aliases/ExtractFormat.md)
|
|
422
|
+
|
|
423
|
+
#### Parameters
|
|
424
|
+
|
|
425
|
+
##### options
|
|
426
|
+
|
|
427
|
+
[`ExtractJobOptions`](../type-aliases/ExtractJobOptions.md)\<`F`\>
|
|
428
|
+
|
|
429
|
+
#### Returns
|
|
430
|
+
|
|
431
|
+
[`ExtractJob`](ExtractJob.md)\<`F`\>
|
|
432
|
+
|
|
433
|
+
#### Throws
|
|
434
|
+
|
|
435
|
+
[LaminaPdfError](LaminaPdfError.md) as [Document.extract](#extract).
|
|
436
|
+
|
|
437
|
+
***
|
|
438
|
+
|
|
389
439
|
### free()
|
|
390
440
|
|
|
391
441
|
> **free**(): `void`
|
|
@@ -404,6 +454,49 @@ calls this at the end of the block.
|
|
|
404
454
|
|
|
405
455
|
***
|
|
406
456
|
|
|
457
|
+
### namedDestination()
|
|
458
|
+
|
|
459
|
+
> **namedDestination**(`name`): `TargetJs` \| `undefined`
|
|
460
|
+
|
|
461
|
+
Where the named destination `name` goes (the names a link or a `#nameddest=` address uses),
|
|
462
|
+
or `undefined` when the document has none by that name. Needs a document opened while the
|
|
463
|
+
extract or text module was loaded.
|
|
464
|
+
|
|
465
|
+
#### Parameters
|
|
466
|
+
|
|
467
|
+
##### name
|
|
468
|
+
|
|
469
|
+
`string`
|
|
470
|
+
|
|
471
|
+
#### Returns
|
|
472
|
+
|
|
473
|
+
`TargetJs` \| `undefined`
|
|
474
|
+
|
|
475
|
+
#### Throws
|
|
476
|
+
|
|
477
|
+
[LaminaPdfError](LaminaPdfError.md) as [Document.outline](#outline).
|
|
478
|
+
|
|
479
|
+
***
|
|
480
|
+
|
|
481
|
+
### outline()
|
|
482
|
+
|
|
483
|
+
> **outline**(): `OutlineNodeJs`[]
|
|
484
|
+
|
|
485
|
+
The outline (bookmarks): its top-level items in order, each with its children, and where
|
|
486
|
+
each goes as a page and a view in page space; empty without one. Needs a document opened
|
|
487
|
+
while the extract or text module was loaded.
|
|
488
|
+
|
|
489
|
+
#### Returns
|
|
490
|
+
|
|
491
|
+
`OutlineNodeJs`[]
|
|
492
|
+
|
|
493
|
+
#### Throws
|
|
494
|
+
|
|
495
|
+
[LaminaPdfError](LaminaPdfError.md) `extract-module-not-loaded` for a document opened in the base
|
|
496
|
+
module; reading errors (`data-pending` for a range document: use `ensure`).
|
|
497
|
+
|
|
498
|
+
***
|
|
499
|
+
|
|
407
500
|
### page()
|
|
408
501
|
|
|
409
502
|
> **page**(`index`): [`PageRef`](PageRef.md)
|
|
@@ -470,6 +563,49 @@ Page `index`'s facts.
|
|
|
470
563
|
|
|
471
564
|
***
|
|
472
565
|
|
|
566
|
+
### pageLinks()
|
|
567
|
+
|
|
568
|
+
> **pageLinks**(`index`): `PageLinkJs`[]
|
|
569
|
+
|
|
570
|
+
The visible links on page `index` (0-based), in the page's annotation order, each with what
|
|
571
|
+
following it does. Nothing is run: a link to a `Launch` or `JavaScript` action is reported as
|
|
572
|
+
`"unsupported"`. Needs a document opened while the extract or text module was loaded.
|
|
573
|
+
|
|
574
|
+
#### Parameters
|
|
575
|
+
|
|
576
|
+
##### index
|
|
577
|
+
|
|
578
|
+
`number`
|
|
579
|
+
|
|
580
|
+
#### Returns
|
|
581
|
+
|
|
582
|
+
`PageLinkJs`[]
|
|
583
|
+
|
|
584
|
+
#### Throws
|
|
585
|
+
|
|
586
|
+
[LaminaPdfError](LaminaPdfError.md) `page-index-out-of-range`; as [Document.outline](#outline).
|
|
587
|
+
|
|
588
|
+
***
|
|
589
|
+
|
|
590
|
+
### properties()
|
|
591
|
+
|
|
592
|
+
> **properties**(): `PropertiesJs`
|
|
593
|
+
|
|
594
|
+
What a properties view shows about the document: Info entries and dates, version, pages,
|
|
595
|
+
size, tagging, encryption and permissions, fonts, signatures (counted, not verified) and
|
|
596
|
+
whether it holds JavaScript, attachments or a form. It reads every object once, so call it
|
|
597
|
+
when the view opens. Needs a document opened while the extract or text module was loaded.
|
|
598
|
+
|
|
599
|
+
#### Returns
|
|
600
|
+
|
|
601
|
+
`PropertiesJs`
|
|
602
|
+
|
|
603
|
+
#### Throws
|
|
604
|
+
|
|
605
|
+
[LaminaPdfError](LaminaPdfError.md) as [Document.outline](#outline).
|
|
606
|
+
|
|
607
|
+
***
|
|
608
|
+
|
|
473
609
|
### rebase()
|
|
474
610
|
|
|
475
611
|
> **rebase**(`bytes`): `void`
|
|
@@ -510,6 +646,36 @@ how it went, or `undefined` when there is nothing to redo.
|
|
|
510
646
|
|
|
511
647
|
***
|
|
512
648
|
|
|
649
|
+
### reflow()
|
|
650
|
+
|
|
651
|
+
> **reflow**(): [`Reflow`](../interfaces/Reflow.md)
|
|
652
|
+
|
|
653
|
+
The document for a reader mode: its blocks in the structure tree's reading order, with
|
|
654
|
+
headings, list items, quotes, captions and notes, and each figure, formula and table as a
|
|
655
|
+
crop of its page with its alternate text, never as reflowed text. A document whose tree is
|
|
656
|
+
missing or can't be trusted (empty, mostly bare spans, too little of the text, or in an order
|
|
657
|
+
the pages' layout contradicts) comes back with `available: false` and the `reason`. Needs a
|
|
658
|
+
document opened in the extract module: load it without the text module, since with both
|
|
659
|
+
loaded documents open in the text module, which leaves reader mode out to keep its size.
|
|
660
|
+
|
|
661
|
+
#### Returns
|
|
662
|
+
|
|
663
|
+
[`Reflow`](../interfaces/Reflow.md)
|
|
664
|
+
|
|
665
|
+
#### Example
|
|
666
|
+
|
|
667
|
+
```ts
|
|
668
|
+
const reflow = doc.reflow();
|
|
669
|
+
if (reflow.available) for (const block of reflow.blocks) console.log(block.kind, block.text);
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
#### Throws
|
|
673
|
+
|
|
674
|
+
[LaminaPdfError](LaminaPdfError.md) `extract-module-not-loaded` in the base or text module;
|
|
675
|
+
reading errors.
|
|
676
|
+
|
|
677
|
+
***
|
|
678
|
+
|
|
513
679
|
### release()
|
|
514
680
|
|
|
515
681
|
> `protected` **release**(): `void`
|
|
@@ -604,6 +770,25 @@ As [Document.save](#save), with the save's report (mode used, bytes written, ren
|
|
|
604
770
|
|
|
605
771
|
***
|
|
606
772
|
|
|
773
|
+
### structureTree()
|
|
774
|
+
|
|
775
|
+
> **structureTree**(): `StructureNodeJs`[] \| `undefined`
|
|
776
|
+
|
|
777
|
+
The structure tree's top-level elements in reading order, or `undefined` for a document
|
|
778
|
+
without one. A text run's `mcid` (on [PageTextRun](PageTextRun.md)) links it to the element whose
|
|
779
|
+
`{ type: "content", page, mcid }` kid names it. Needs the extract or text module, as
|
|
780
|
+
`page.text()` does.
|
|
781
|
+
|
|
782
|
+
#### Returns
|
|
783
|
+
|
|
784
|
+
`StructureNodeJs`[] \| `undefined`
|
|
785
|
+
|
|
786
|
+
#### Throws
|
|
787
|
+
|
|
788
|
+
[LaminaPdfError](LaminaPdfError.md) `extract-module-not-loaded`; reading errors.
|
|
789
|
+
|
|
790
|
+
***
|
|
791
|
+
|
|
607
792
|
### transact()
|
|
608
793
|
|
|
609
794
|
> **transact**\<`T`\>(`edit`): `T`
|