@laminapdf/sdk 0.2.0-alpha.2 → 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 +63 -8
- package/dist/api.d.ts +8 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -2
- package/dist/api.js.map +1 -1
- package/dist/builder.d.ts +43 -22
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +122 -83
- package/dist/builder.js.map +1 -1
- package/dist/document.d.ts +89 -22
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +177 -67
- package/dist/document.js.map +1 -1
- package/dist/errors.d.ts +5 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -16
- package/dist/errors.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 +57 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +5 -0
- package/dist/extract.js.map +1 -0
- package/dist/font.d.ts +13 -6
- package/dist/font.d.ts.map +1 -1
- package/dist/font.js +50 -20
- package/dist/font.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 +18 -6
- package/dist/generated/codes.d.ts.map +1 -1
- package/dist/generated/codes.js +114 -5
- package/dist/generated/codes.js.map +1 -1
- package/dist/generated/explain.d.ts.map +1 -1
- package/dist/generated/explain.js +45 -11
- package/dist/generated/explain.js.map +1 -1
- package/dist/generated/extract.d.ts +282 -0
- package/dist/generated/extract.d.ts.map +1 -0
- package/dist/generated/extract.js +4 -0
- package/dist/generated/extract.js.map +1 -0
- package/dist/init.d.ts +13 -5
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +23 -11
- package/dist/init.js.map +1 -1
- package/dist/internal/handle.d.ts +58 -0
- package/dist/internal/handle.d.ts.map +1 -0
- package/dist/internal/handle.js +113 -0
- package/dist/internal/handle.js.map +1 -0
- package/dist/internal/instance.d.ts +56 -0
- package/dist/internal/instance.d.ts.map +1 -0
- package/dist/internal/instance.js +125 -0
- package/dist/internal/instance.js.map +1 -0
- package/dist/source/http.d.ts +1 -1
- package/dist/source/http.js +2 -2
- package/dist/source/http.js.map +1 -1
- package/dist/source/range.d.ts +6 -1
- package/dist/source/range.d.ts.map +1 -1
- package/dist/source/range.js +10 -6
- package/dist/source/range.js.map +1 -1
- package/dist/text.d.ts +3 -3
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +3 -3
- package/dist/text.js.map +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 +2 -2
- package/dist/version.js.map +1 -1
- package/dist/worker/client.d.ts +3 -2
- package/dist/worker/client.d.ts.map +1 -1
- package/dist/worker/client.js +6 -4
- package/dist/worker/client.js.map +1 -1
- package/dist/worker/entry.js +1 -1
- package/dist/worker/entry.js.map +1 -1
- package/dist/worker/server.d.ts.map +1 -1
- package/dist/worker/server.js +42 -9
- package/dist/worker/server.js.map +1 -1
- package/dist/worker/support.d.ts +13 -3
- package/dist/worker/support.d.ts.map +1 -1
- package/dist/worker/support.js +5 -0
- package/dist/worker/support.js.map +1 -1
- package/dist/worker/types.d.ts +8 -1
- package/dist/worker/types.d.ts.map +1 -1
- package/docs/AGENTS.md +14 -0
- package/docs/api/README.md +166 -0
- package/docs/api/classes/Builder.md +467 -0
- package/docs/api/classes/Document.md +854 -0
- package/docs/api/classes/ExtractJob.md +236 -0
- package/docs/api/classes/Font.md +74 -0
- package/docs/api/classes/Image.md +140 -0
- package/docs/api/classes/LaminaPdfError.md +189 -0
- package/docs/api/classes/Page.md +178 -0
- package/docs/api/classes/PageRef.md +253 -0
- package/docs/api/classes/PageText.md +129 -0
- package/docs/api/classes/PageTextRun.md +167 -0
- package/docs/api/classes/PendingPath.md +97 -0
- package/docs/api/classes/SaveJob.md +205 -0
- package/docs/api/classes/Surface.md +331 -0
- package/docs/api/classes/Transaction.md +111 -0
- package/docs/api/functions/callbackSource.md +33 -0
- package/docs/api/functions/extractWithModels.md +70 -0
- package/docs/api/functions/httpRangeSource.md +48 -0
- package/docs/api/functions/init.md +36 -0
- package/docs/api/functions/isExtractLoaded.md +21 -0
- package/docs/api/functions/isInitialized.md +19 -0
- package/docs/api/functions/isLaminaPdfError.md +41 -0
- package/docs/api/functions/isTextLoaded.md +19 -0
- package/docs/api/functions/loadExtract.md +28 -0
- package/docs/api/functions/loadText.md +28 -0
- package/docs/api/functions/onLeak.md +29 -0
- package/docs/api/functions/reset.md +22 -0
- package/docs/api/functions/wasmMemory.md +22 -0
- package/docs/api/interfaces/BuilderOptions.md +108 -0
- package/docs/api/interfaces/ByteRange.md +29 -0
- package/docs/api/interfaces/ChunkOptions.md +37 -0
- package/docs/api/interfaces/Diagnostic.md +67 -0
- package/docs/api/interfaces/ExtractOptions.md +92 -0
- package/docs/api/interfaces/ExtractResult.md +37 -0
- package/docs/api/interfaces/FontInfo.md +37 -0
- package/docs/api/interfaces/HostModels.md +57 -0
- package/docs/api/interfaces/HttpRangeOptions.md +78 -0
- package/docs/api/interfaces/InitOptions.md +40 -0
- package/docs/api/interfaces/LayoutRegion.md +38 -0
- package/docs/api/interfaces/Leak.md +21 -0
- package/docs/api/interfaces/Location.md +53 -0
- 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 +25 -0
- package/docs/api/interfaces/OpenOptions.md +37 -0
- package/docs/api/interfaces/PageTextOptions.md +21 -0
- package/docs/api/interfaces/PathBuilder.md +195 -0
- package/docs/api/interfaces/QuadPoint.md +25 -0
- package/docs/api/interfaces/RangeOptions.md +54 -0
- package/docs/api/interfaces/RangeSource.md +59 -0
- package/docs/api/interfaces/StrokeStyle.md +61 -0
- package/docs/api/interfaces/TagSpec.md +69 -0
- package/docs/api/interfaces/TextBoxOptions.md +93 -0
- package/docs/api/interfaces/TextGlyph.md +29 -0
- package/docs/api/interfaces/TextOptions.md +101 -0
- package/docs/api/interfaces/WasmMemory.md +37 -0
- package/docs/api/type-aliases/AfRelationship.md +15 -0
- package/docs/api/type-aliases/Align.md +15 -0
- package/docs/api/type-aliases/ArtifactKind.md +15 -0
- package/docs/api/type-aliases/AttachmentOptions.md +15 -0
- package/docs/api/type-aliases/BlendMode.md +15 -0
- package/docs/api/type-aliases/BoxRect.md +15 -0
- package/docs/api/type-aliases/BuildOptions.md +15 -0
- package/docs/api/type-aliases/Cell.md +71 -0
- package/docs/api/type-aliases/Chunk.md +79 -0
- package/docs/api/type-aliases/Color.md +16 -0
- package/docs/api/type-aliases/Coordinates.md +55 -0
- package/docs/api/type-aliases/Direction.md +15 -0
- package/docs/api/type-aliases/DocumentInfo.md +15 -0
- package/docs/api/type-aliases/DropReason.md +15 -0
- package/docs/api/type-aliases/Dropped.md +59 -0
- package/docs/api/type-aliases/Edited.md +15 -0
- package/docs/api/type-aliases/ErrorCode.md +15 -0
- package/docs/api/type-aliases/ErrorKind.md +15 -0
- package/docs/api/type-aliases/ExtractFormat.md +15 -0
- 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 +94 -0
- package/docs/api/type-aliases/ExtractedPage.md +73 -0
- package/docs/api/type-aliases/ExtractedSource.md +48 -0
- package/docs/api/type-aliases/Extraction.md +22 -0
- package/docs/api/type-aliases/FillRule.md +15 -0
- package/docs/api/type-aliases/Fit.md +15 -0
- package/docs/api/type-aliases/Flags.md +15 -0
- package/docs/api/type-aliases/Generator.md +43 -0
- package/docs/api/type-aliases/GlyphQuad.md +15 -0
- package/docs/api/type-aliases/InfoPatch.md +15 -0
- package/docs/api/type-aliases/LaminaPdfWarning.md +16 -0
- package/docs/api/type-aliases/LimitName.md +15 -0
- package/docs/api/type-aliases/Limits.md +15 -0
- package/docs/api/type-aliases/LineBox.md +15 -0
- package/docs/api/type-aliases/LineCap.md +15 -0
- package/docs/api/type-aliases/LineJoin.md +15 -0
- package/docs/api/type-aliases/LinkTarget.md +15 -0
- package/docs/api/type-aliases/Metadata.md +15 -0
- package/docs/api/type-aliases/ModelResult.md +15 -0
- package/docs/api/type-aliases/Op.md +15 -0
- package/docs/api/type-aliases/OutlineEntry.md +15 -0
- package/docs/api/type-aliases/OutlineNode.md +15 -0
- package/docs/api/type-aliases/Overflow.md +15 -0
- package/docs/api/type-aliases/PageInfo.md +15 -0
- package/docs/api/type-aliases/PageLabel.md +15 -0
- package/docs/api/type-aliases/PageSizeName.md +15 -0
- package/docs/api/type-aliases/Point.md +15 -0
- package/docs/api/type-aliases/Profile.md +15 -0
- package/docs/api/type-aliases/Progress.md +15 -0
- package/docs/api/type-aliases/ReadingOrder.md +15 -0
- package/docs/api/type-aliases/Rect.md +15 -0
- package/docs/api/type-aliases/Region.md +31 -0
- package/docs/api/type-aliases/RegionLabel.md +15 -0
- package/docs/api/type-aliases/RenderMode.md +15 -0
- package/docs/api/type-aliases/Rotation.md +15 -0
- package/docs/api/type-aliases/SaveOptions.md +15 -0
- package/docs/api/type-aliases/SaveReport.md +15 -0
- package/docs/api/type-aliases/Span.md +74 -0
- package/docs/api/type-aliases/SplitOn.md +15 -0
- package/docs/api/type-aliases/Standard14.md +15 -0
- package/docs/api/type-aliases/StructRef.md +41 -0
- package/docs/api/type-aliases/StructSource.md +17 -0
- 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 +15 -0
- package/docs/api/type-aliases/TableMode.md +15 -0
- package/docs/api/type-aliases/TableScope.md +15 -0
- package/docs/api/type-aliases/Tag.md +15 -0
- package/docs/api/type-aliases/TagName.md +15 -0
- 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 +15 -0
- package/docs/api/type-aliases/TextRange.md +33 -0
- package/docs/api/type-aliases/TextRunInfo.md +15 -0
- package/docs/api/type-aliases/Transform.md +15 -0
- package/docs/api/type-aliases/UndoOutcome.md +15 -0
- package/docs/api/type-aliases/ViewerPreferences.md +15 -0
- package/docs/api/type-aliases/WarningCode.md +15 -0
- package/docs/api/type-aliases/WasmSource.md +16 -0
- package/docs/api/variables/Matrix.md +99 -0
- package/docs/api/variables/PAGE_SIZES.md +15 -0
- package/docs/api/variables/TAG_NAMES.md +15 -0
- package/docs/errors/README.md +173 -0
- package/docs/errors/aes-padding-invalid.md +34 -0
- package/docs/errors/already-initialized.md +34 -0
- package/docs/errors/binary-output-to-terminal.md +35 -0
- package/docs/errors/builder-finished.md +35 -0
- package/docs/errors/cancelled.md +35 -0
- package/docs/errors/cmap-invalid.md +42 -0
- package/docs/errors/collection-index.md +33 -0
- package/docs/errors/color-components.md +33 -0
- package/docs/errors/content-bad-operands.md +36 -0
- package/docs/errors/content-path-unpainted.md +36 -0
- package/docs/errors/content-resource-missing.md +37 -0
- package/docs/errors/content-syntax.md +36 -0
- package/docs/errors/content-unbalanced-bt.md +36 -0
- package/docs/errors/content-unbalanced-marked.md +36 -0
- package/docs/errors/content-unbalanced-q.md +36 -0
- package/docs/errors/content-unknown-operator.md +37 -0
- package/docs/errors/covered-text.md +33 -0
- package/docs/errors/data-pending.md +34 -0
- package/docs/errors/decompress.md +34 -0
- package/docs/errors/device-color-without-output-intent.md +33 -0
- package/docs/errors/direct-page.md +34 -0
- package/docs/errors/disposed.md +34 -0
- package/docs/errors/document-changed.md +34 -0
- package/docs/errors/embedded-file-forbidden.md +35 -0
- package/docs/errors/embedded-file-without-mime-type.md +36 -0
- package/docs/errors/encoding-full.md +34 -0
- package/docs/errors/encrypted-base.md +33 -0
- package/docs/errors/extract-column-order-uncertain.md +38 -0
- package/docs/errors/extract-limit-blocks.md +35 -0
- package/docs/errors/extract-module-not-loaded.md +37 -0
- package/docs/errors/extract-needs-ocr.md +37 -0
- package/docs/errors/extract-reading-order-ambiguous.md +32 -0
- package/docs/errors/extract-struct-tree-ignored.md +32 -0
- package/docs/errors/extract-table-ambiguous.md +32 -0
- package/docs/errors/extract-table-limit.md +35 -0
- package/docs/errors/extract-untagged-content.md +32 -0
- package/docs/errors/fetch-failed.md +34 -0
- package/docs/errors/flate-truncated.md +34 -0
- 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 +36 -0
- package/docs/errors/font-mismatch.md +34 -0
- package/docs/errors/font-not-embeddable.md +34 -0
- package/docs/errors/font-not-embedded.md +35 -0
- package/docs/errors/font-not-shapable.md +33 -0
- package/docs/errors/glyph-out-of-range.md +34 -0
- package/docs/errors/glyph-without-unicode.md +37 -0
- package/docs/errors/heading-level-skipped.md +36 -0
- package/docs/errors/image-data-length.md +33 -0
- package/docs/errors/image-too-large.md +32 -0
- package/docs/errors/inline-image-unterminated.md +36 -0
- package/docs/errors/input-unreadable.md +37 -0
- package/docs/errors/instance-reset.md +34 -0
- package/docs/errors/invalid-argument.md +33 -0
- package/docs/errors/invalid-axis-value.md +32 -0
- package/docs/errors/invalid-box.md +34 -0
- package/docs/errors/invalid-color.md +32 -0
- package/docs/errors/invalid-command-line.md +44 -0
- package/docs/errors/invalid-date.md +34 -0
- package/docs/errors/invalid-entry.md +34 -0
- package/docs/errors/invalid-feature.md +32 -0
- package/docs/errors/invalid-font.md +32 -0
- package/docs/errors/invalid-geometry.md +32 -0
- package/docs/errors/invalid-icc-profile.md +32 -0
- package/docs/errors/invalid-image.md +33 -0
- package/docs/errors/invalid-op-log.md +33 -0
- package/docs/errors/invalid-page-label.md +34 -0
- package/docs/errors/invalid-page-labels.md +32 -0
- package/docs/errors/invalid-page-range.md +37 -0
- package/docs/errors/invalid-rotate.md +34 -0
- package/docs/errors/invalid-spans.md +39 -0
- package/docs/errors/invalid-structure-nesting.md +38 -0
- package/docs/errors/invalid-structure.md +34 -0
- package/docs/errors/invalid-text-range.md +33 -0
- package/docs/errors/job-finished.md +34 -0
- package/docs/errors/limit-exceeded.md +38 -0
- package/docs/errors/link-without-contents.md +33 -0
- package/docs/errors/link-without-structure.md +37 -0
- 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 +33 -0
- package/docs/errors/missing-glyph.md +33 -0
- package/docs/errors/missing-header.md +37 -0
- package/docs/errors/missing-lang.md +32 -0
- package/docs/errors/missing-root.md +34 -0
- package/docs/errors/missing-title.md +32 -0
- 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 +34 -0
- package/docs/errors/nested-transaction.md +34 -0
- package/docs/errors/no-pending-save.md +32 -0
- package/docs/errors/no-transaction.md +33 -0
- package/docs/errors/not-initialized.md +35 -0
- package/docs/errors/not-pdf.md +33 -0
- package/docs/errors/not-rebased.md +35 -0
- package/docs/errors/object-number-out-of-range.md +38 -0
- package/docs/errors/objstm-index-mismatch.md +36 -0
- package/docs/errors/out-of-memory.md +38 -0
- package/docs/errors/outline-cycle.md +34 -0
- package/docs/errors/outline-item-skipped.md +34 -0
- package/docs/errors/output-unwritable.md +37 -0
- package/docs/errors/overwrite-refused.md +36 -0
- package/docs/errors/page-count-mismatch.md +34 -0
- package/docs/errors/page-index-out-of-range.md +34 -0
- package/docs/errors/page-tree-node-skipped.md +35 -0
- package/docs/errors/password-required.md +36 -0
- package/docs/errors/path-outside-roots.md +32 -0
- package/docs/errors/perms-mismatch.md +34 -0
- package/docs/errors/profile-version-conflict.md +35 -0
- package/docs/errors/redaction-not-applied.md +32 -0
- package/docs/errors/reference-cycle.md +35 -0
- package/docs/errors/render-backend-unavailable.md +32 -0
- package/docs/errors/render-failed.md +33 -0
- package/docs/errors/render-too-large.md +36 -0
- package/docs/errors/repaired-base.md +34 -0
- package/docs/errors/requires-rewrite.md +38 -0
- package/docs/errors/revision-index-out-of-range.md +34 -0
- package/docs/errors/saved-not-rebased.md +34 -0
- package/docs/errors/sink-not-empty.md +33 -0
- package/docs/errors/sink.md +31 -0
- package/docs/errors/source-budget-exceeded.md +34 -0
- package/docs/errors/source-changed.md +33 -0
- package/docs/errors/source.md +30 -0
- package/docs/errors/stale-generation.md +34 -0
- package/docs/errors/stream-length-recovered.md +37 -0
- package/docs/errors/strict.md +34 -0
- package/docs/errors/subset-failed.md +31 -0
- package/docs/errors/syntax.md +34 -0
- 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 +36 -0
- package/docs/errors/text-overflow.md +34 -0
- package/docs/errors/tounicode-conflict.md +32 -0
- package/docs/errors/type.md +34 -0
- package/docs/errors/unexpected-eof.md +34 -0
- package/docs/errors/unknown-axis.md +33 -0
- package/docs/errors/unknown-code.md +36 -0
- package/docs/errors/unknown-destination.md +33 -0
- package/docs/errors/unknown-font.md +33 -0
- package/docs/errors/unknown-option.md +33 -0
- package/docs/errors/unknown-page.md +34 -0
- package/docs/errors/unmapped-glyph.md +36 -0
- package/docs/errors/unnumbered-heading-misused.md +34 -0
- package/docs/errors/unset-object.md +30 -0
- package/docs/errors/unsupported-filter.md +34 -0
- package/docs/errors/unsupported-image.md +33 -0
- package/docs/errors/unsupported-layout-option.md +33 -0
- package/docs/errors/unsupported-security-handler.md +34 -0
- package/docs/errors/unsupported-version.md +32 -0
- package/docs/errors/untagged-content.md +35 -0
- package/docs/errors/warnings-truncated.md +35 -0
- package/docs/errors/wasm-trap.md +37 -0
- package/docs/errors/whole-font-rebuilt.md +30 -0
- package/docs/errors/worker-crashed.md +33 -0
- package/docs/errors/worker-failed.md +32 -0
- package/docs/errors/worker-version-mismatch.md +34 -0
- package/docs/errors/would-invalidate-signatures.md +38 -0
- package/docs/errors/wrong-document.md +33 -0
- package/docs/errors/wrong-password.md +34 -0
- package/docs/errors/xobject-cycle.md +36 -0
- package/docs/errors/xref-repaired.md +36 -0
- package/docs/errors/xrefstm-ignored.md +34 -0
- package/docs/llms.txt +94 -0
- package/docs/pages/concepts/dependencies.md +44 -0
- package/docs/pages/concepts/drawing-pages.md +76 -0
- package/docs/pages/concepts/errors-and-warnings.md +68 -0
- package/docs/pages/concepts/how-lamina-thinks.md +98 -0
- package/docs/pages/concepts/pages-and-coordinates.md +75 -0
- package/docs/pages/guides/accessible-pdfs.md +262 -0
- package/docs/pages/guides/archival-pdfs.md +433 -0
- package/docs/pages/guides/edit-a-pdf.md +143 -0
- package/docs/pages/guides/flowing-pages.md +379 -0
- package/docs/pages/guides/fonts-and-text.md +204 -0
- package/docs/pages/guides/images-and-vectors.md +221 -0
- package/docs/pages/guides/keep-the-page-responsive.md +85 -0
- package/docs/pages/guides/links-outlines-and-metadata.md +224 -0
- package/docs/pages/guides/open-large-files.md +69 -0
- package/docs/pages/guides/password-protected-files.md +70 -0
- package/docs/pages/guides/save-a-pdf.md +154 -0
- package/docs/pages/guides/test-generated-pdfs.md +324 -0
- package/docs/pages/guides/untrusted-files.md +82 -0
- package/docs/pages/index.md +33 -0
- package/docs/pages/install.md +79 -0
- package/docs/pages/quick-start/browser.md +71 -0
- package/docs/pages/quick-start/bun.md +64 -0
- package/docs/pages/quick-start/deno.md +62 -0
- package/docs/pages/quick-start/node.md +65 -0
- package/docs/pages/quick-start/rust.md +62 -0
- package/docs/pages/quick-start/workers.md +139 -0
- package/docs/pages/recipes/cloudflare-worker.md +115 -0
- package/docs/pages/recipes/element-flow.md +248 -0
- package/docs/pages/recipes/extract-markdown.md +152 -0
- package/docs/pages/recipes/generate-then-edit.md +142 -0
- package/docs/pages/recipes/hello.md +101 -0
- package/docs/pages/recipes/images-and-vectors.md +216 -0
- package/docs/pages/recipes/invoice.md +233 -0
- package/docs/pages/recipes/links-and-outlines.md +222 -0
- package/docs/pages/recipes/multilingual.md +196 -0
- package/docs/pages/recipes/open-untrusted.md +65 -0
- package/docs/pages/recipes/pdf-a-archive.md +212 -0
- package/docs/pages/recipes/pdf-a3-invoice-with-xml.md +229 -0
- package/docs/pages/recipes/pdf-ua-report.md +244 -0
- package/docs/pages/recipes/report.md +125 -0
- package/docs/pages/recipes/web-worker-client.md +64 -0
- package/docs/pages/recipes.md +48 -0
- package/docs/pages/reference/benchmarks.md +93 -0
- package/docs/pages/reference/changelog.md +134 -0
- package/docs/pages/reference/codes.md +14 -0
- package/docs/pages/reference/glossary.md +108 -0
- package/docs/pages/reference/rust.md +36 -0
- package/docs/pages/reference/stability.md +59 -0
- package/docs/pages/start/coding-agents.md +45 -0
- package/docs/pages/start/first-pdf.md +81 -0
- package/docs/pages/troubleshooting.md +74 -0
- package/docs/renames.json +86 -0
- package/docs/schemas/error.schema.json +322 -0
- package/docs/schemas/renames.schema.json +29 -0
- package/package.json +7 -3
- package/schemas/error.schema.json +37 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-column-order-uncertain"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-column-order-uncertain/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-column-order-uncertain
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `unsupported` (something Lamina PDF can't do yet)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
Extraction 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A 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:
|
|
19
|
+
|
|
20
|
+
- `narrow-gutter`: two columns sit closer together than a font size, so lines may have been read straight across both columns.
|
|
21
|
+
- `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.
|
|
22
|
+
- `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.
|
|
23
|
+
|
|
24
|
+
A page that mixes horizontal and vertical writing raises [`extract-reading-order-ambiguous`](extract-reading-order-ambiguous.md) instead.
|
|
25
|
+
|
|
26
|
+
## How to fix
|
|
27
|
+
|
|
28
|
+
Check 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.
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
A 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`.
|
|
33
|
+
|
|
34
|
+
## Data fields
|
|
35
|
+
|
|
36
|
+
- `reason`: `narrow-gutter`, `columns-revisited` or `near-grid`, the first check that doubted the order.
|
|
37
|
+
|
|
38
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-limit-blocks"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-limit-blocks/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-limit-blocks
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `limit` (a `Limits` value or another resource bound was hit)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A page had more runs of text than `ExtractLimits::max_blocks_per_page` allows. Since each run can be a block of its own, extraction kept the first runs the page draws and left out the rest. It cuts them before grouping runs into blocks, so the work stays bounded.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A page of many tiny separate pieces of text, such as a dense table, a map with hundreds of labels, or a file built to slow extraction down.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Raise `max_blocks_per_page` if the page really holds that many blocks.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let mut options = laminapdf_extract::ExtractOptions::default();
|
|
28
|
+
options.limits.max_blocks_per_page = 50_000;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Data fields
|
|
32
|
+
|
|
33
|
+
- `limit`: the limit that was reached.
|
|
34
|
+
|
|
35
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-module-not-loaded"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-module-not-loaded/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-module-not-loaded
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `state` (the call isn't valid in the object's current state)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`page.text()` of `@laminapdf/sdk` was called on a page of a document opened in the base module, which has no text extraction.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
`@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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Load 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
await init();
|
|
28
|
+
const doc = Document.open(bytes);
|
|
29
|
+
doc.page(0).text(); // throws { code: "extract-module-not-loaded", … }
|
|
30
|
+
|
|
31
|
+
await loadExtract();
|
|
32
|
+
Document.open(bytes).page(0).text().text(); // works
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Data fields
|
|
36
|
+
|
|
37
|
+
None.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-needs-ocr"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-needs-ocr/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-needs-ocr
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `unsupported` (something Lamina PDF can't do yet)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
The 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`.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A page's text comes from its fonts. Some pages draw their words in other ways:
|
|
19
|
+
|
|
20
|
+
- a scanned page is one image, with no text at all;
|
|
21
|
+
- 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;
|
|
22
|
+
- outlined text is drawn as shapes, not glyphs;
|
|
23
|
+
- a font without a Unicode mapping draws glyphs that extraction can't turn into characters.
|
|
24
|
+
|
|
25
|
+
## How to fix
|
|
26
|
+
|
|
27
|
+
Send 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.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
A scanned contract: every page is `needs-ocr`, and the extraction's Markdown is empty.
|
|
32
|
+
|
|
33
|
+
## Data fields
|
|
34
|
+
|
|
35
|
+
- `status`: the page's text-layer status, `needs-ocr` or `ocr-layer`.
|
|
36
|
+
|
|
37
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-reading-order-ambiguous"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-reading-order-ambiguous/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-reading-order-ambiguous
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `unsupported` (valid input that Lamina PDF doesn't implement)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A page mixes horizontal and vertical writing. Extraction put its blocks in an order, but no layout rule tells which comes first, so the order is a guess.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Japanese and Chinese pages often set the body vertically and captions, headings or page numbers horizontally. Without a structure tree, nothing in the file says how the two relate.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing to do in Lamina PDF; the file is valid. Like every warning, it fails the call in strict mode. Check the order of that page's blocks, or ask for the order the content stream draws (`ReadingOrder::ContentStream`). A tagged file avoids the guess.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
A page whose body text is drawn with a vertical font (`Identity-V`) and whose page number is drawn with a horizontal one.
|
|
27
|
+
|
|
28
|
+
## Data fields
|
|
29
|
+
|
|
30
|
+
None.
|
|
31
|
+
|
|
32
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-struct-tree-ignored"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-struct-tree-ignored/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-struct-tree-ignored
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (a problem with the PDF file)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
The 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
A report whose tool tagged only its headings: the tree covers a tenth of the text, so the reason is `coverage`.
|
|
27
|
+
|
|
28
|
+
## Data fields
|
|
29
|
+
|
|
30
|
+
- `reason`: `coverage` or `order`, the check that failed.
|
|
31
|
+
|
|
32
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-table-ambiguous"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-table-ambiguous/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-table-ambiguous
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `unsupported` (valid input that Lamina PDF doesn't implement)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
Extraction found a table drawn with lines, but the cells its missing lines would join don't make a rectangle. Extraction kept the table and gave it one cell per square of its grid, so a merged cell's text sits in the first of the squares it covers.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A table's lines tell where cells are merged: a missing line between two squares joins them. Joined squares that form an L or a T shape don't describe a cell, usually because a line is drawn slightly short, drawn twice in different places, or covered by a white rectangle.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing to do in Lamina PDF; the file is valid. Like every warning, it fails the call in strict mode. Check that table's cells: the text of a merged cell may be split across its neighbours.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
A table whose header spans two columns over the first row only, but whose line under that header stops halfway.
|
|
27
|
+
|
|
28
|
+
## Data fields
|
|
29
|
+
|
|
30
|
+
None.
|
|
31
|
+
|
|
32
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-table-limit"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-table-limit/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-table-limit
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `limit` (a `Limits` value or another resource bound was hit)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Raise `max_table_cells` if the page really holds a table that big.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let mut options = laminapdf_extract::ExtractOptions::default();
|
|
28
|
+
options.limits.max_table_cells = 50_000;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Data fields
|
|
32
|
+
|
|
33
|
+
- `limit`: the limit that was reached.
|
|
34
|
+
|
|
35
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "extract-untagged-content"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/extract-untagged-content/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# extract-untagged-content
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (a problem with the PDF file)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
The 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
In 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
A tagged contract with a "DRAFT" stamp drawn after tagging: the stamp's text comes after the contract's blocks.
|
|
27
|
+
|
|
28
|
+
## Data fields
|
|
29
|
+
|
|
30
|
+
- `chars`: how many characters (spaces left out) lie outside the tree.
|
|
31
|
+
|
|
32
|
+
The `location` has the page's `pageIndex`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "fetch-failed"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/fetch-failed/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# fetch-failed
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `io` (the host failed to supply bytes; often transient)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Opening 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Check 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const doc = await Document.openRange(httpRangeSource(url)); // throws { code: "fetch-failed", data: { status: 403 } }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Data fields
|
|
31
|
+
|
|
32
|
+
- `reason`: `network`, `status`, `content-range` or `length` (Lamina PDF's own words). The URL is never included.
|
|
33
|
+
- `status`: the HTTP status, when there was a response.
|
|
34
|
+
- `expected`, `got`: for `length`, the bytes asked for and the bytes returned.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "flate-truncated"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/flate-truncated/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# flate-truncated
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
Flate data was truncated or had a bad checksum; the partial output was kept.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Truncated downloads or damaged streams.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing, if the content looks right; part of the stream may be missing.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
5 0 obj << /Filter /FlateDecode /Length 900 >> stream …(the zlib data stops early)… endstream
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Lamina PDF keeps what inflated before the data ended or the Adler-32 checksum failed; the content may be cut short. The warning carries the stream's `object`.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
None.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "flow-content-too-large"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/flow-content-too-large/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# flow-content-too-large
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Make 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let tall = Image::rgba(1, 10, &[0; 40])?; // ten times as tall as it is wide
|
|
28
|
+
let flow = Flow::new(PageTemplate::new(PageSize::A6)).block(FlowBlock::Figure(Figure::new(tall, "A bar")));
|
|
29
|
+
builder.flow(&flow)?; // flow-content-too-large
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `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.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "flow-keep-broken"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/flow-keep-broken/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# flow-keep-broken
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Blocks 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Keep 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.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let group = FlowBlock::Keep(vec![long_intro, long_paragraph]); // taller than a page
|
|
28
|
+
let report = builder.flow(&Flow::new(template).block(group))?;
|
|
29
|
+
assert_eq!(report.warnings[0].code(), "flow-keep-broken");
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `page`: the page the blocks start on, counted from 0 within the flow.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "flow-layout-unstable"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/flow-layout-unstable/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# flow-layout-unstable
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `internal` (a bug in Lamina PDF or a broken invariant)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A 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.
|
|
19
|
+
|
|
20
|
+
The 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.
|
|
21
|
+
|
|
22
|
+
## How to fix
|
|
23
|
+
|
|
24
|
+
Report 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.
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
```rust
|
|
29
|
+
let flow = Flow::new(template)
|
|
30
|
+
.block(FlowBlock::Contents(Contents::new(&style)))
|
|
31
|
+
.block(FlowBlock::PageBreak) // the headings start on their own pages
|
|
32
|
+
.block(FlowBlock::Heading(1, Paragraph::plain("Introduction", &heading)));
|
|
33
|
+
builder.flow(&flow)?;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Data fields
|
|
37
|
+
|
|
38
|
+
None.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "font-invalid"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/font-invalid/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# font-invalid
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A font dictionary read for text extraction has a missing, unreadable or malformed entry (the descendant font, `/Encoding` or its `/Differences`, `/Widths`, `/W`, `/W2`, the font descriptor or its font program). Its text was decoded with defaults: the standard encoding, the standard 14 font's widths or `/MissingWidth`, `/DW`.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A producer bug, a damaged file, or a font dictionary that relies on what a viewer guesses.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing to do. Text or positions extracted for that font may be off; regenerating the file with a current producer fixes it.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
<< /Type /Font /Subtype /Type0 /BaseFont /Foo /Encoding /Identity-H /DescendantFonts 99 0 R >>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The descendant font is missing, so text in this font is decoded with defaults: two-byte codes, default widths. The `location` is the font dictionary's `object`.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
None.
|
|
35
|
+
|
|
36
|
+
The `location` is `object`, the font dictionary's object; none for a direct font dictionary.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "font-mismatch"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/font-mismatch/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# font-mismatch
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Glyph 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Register 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`.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let run = shaper.shape(¬o, text, &options)?;
|
|
28
|
+
pdf_run(&run, text, &mut registry, roboto_key)?; // font-mismatch: shaped with Noto
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Data fields
|
|
32
|
+
|
|
33
|
+
- `font`: the registered font's PostScript name (**untrusted**: read from the font).
|
|
34
|
+
- `shaped_with`: the PostScript name of the font the run was shaped with (**untrusted**: read from the font).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "font-not-embeddable"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/font-not-embeddable/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# font-not-embeddable
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`FontRegistry::add` refused a font whose `OS/2.fsType` forbids embedding (restricted licence, or bitmap embedding only).
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Font vendors mark fonts whose licence does not allow embedding in documents (OpenType `OS/2` table; research 03 §6.3). `fsType` is advisory; the licence is what counts.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Use another font, or, if your licence allows embedding, register it with `EmbedPolicy::Override`.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
registry.add(restricted_font, EmbedPolicy::Respect)?; // font-not-embeddable
|
|
28
|
+
registry.add(restricted_font, EmbedPolicy::Override)?; // only if your licence allows embedding
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Data fields
|
|
32
|
+
|
|
33
|
+
- `font`: the font's PostScript name (**untrusted**: read from the font).
|
|
34
|
+
- `fs_type`: the `fsType` bits.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "font-not-embedded"
|
|
3
|
+
version: "0.2.0-alpha.4"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/font-not-embedded/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# font-not-embedded
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
Text 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.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
The 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.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Load a font file with `Builder::font` (or `Builder::font_bytes` in the façade): Lamina PDF embeds the subset of glyphs you draw.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let bold = builder.standard_font(Standard14::HelveticaBold)?;
|
|
28
|
+
surface.text("Invoice", &bold, Pt::new(24.0), at)?;
|
|
29
|
+
builder.finish()?; // font-not-embedded under Profile::PdfA2b
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `profile`: the profile, such as `PDF/A-2b`.
|
|
35
|
+
- `font`: the font's PostScript name, such as `Helvetica-Bold`.
|