@laminapdf/sdk 0.2.0-alpha.2 → 0.2.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -7
- package/dist/api.d.ts +5 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +3 -2
- package/dist/api.js.map +1 -1
- package/dist/builder.d.ts +35 -19
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +114 -80
- package/dist/builder.js.map +1 -1
- package/dist/document.d.ts +47 -21
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +112 -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.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/codes.d.ts +18 -6
- package/dist/generated/codes.d.ts.map +1 -1
- package/dist/generated/codes.js +59 -4
- package/dist/generated/codes.js.map +1 -1
- package/dist/generated/explain.d.ts.map +1 -1
- package/dist/generated/explain.js +27 -10
- package/dist/generated/explain.js.map +1 -1
- package/dist/generated/extract.d.ts +235 -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.js +1 -1
- 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/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 +6 -2
- package/dist/worker/support.d.ts.map +1 -1
- package/dist/worker/support.js +1 -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 +147 -0
- package/docs/api/classes/Builder.md +467 -0
- package/docs/api/classes/Document.md +742 -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 +326 -0
- package/docs/api/classes/Transaction.md +111 -0
- package/docs/api/functions/callbackSource.md +33 -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/HttpRangeOptions.md +78 -0
- package/docs/api/interfaces/InitOptions.md +40 -0
- package/docs/api/interfaces/Leak.md +21 -0
- package/docs/api/interfaces/Location.md +53 -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/ExtractedBlock.md +82 -0
- package/docs/api/type-aliases/ExtractedPage.md +65 -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 +41 -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/Op.md +15 -0
- package/docs/api/type-aliases/OutlineEntry.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/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 +63 -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/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/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 +156 -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/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-limit-blocks.md +35 -0
- package/docs/errors/extract-module-not-loaded.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/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 +35 -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-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/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/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/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/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/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 +88 -0
- package/docs/pages/concepts/dependencies.md +44 -0
- package/docs/pages/concepts/errors-and-warnings.md +64 -0
- package/docs/pages/concepts/how-lamina-thinks.md +86 -0
- package/docs/pages/concepts/pages-and-coordinates.md +67 -0
- package/docs/pages/guides/accessible-pdfs.md +260 -0
- package/docs/pages/guides/archival-pdfs.md +429 -0
- package/docs/pages/guides/edit-a-pdf.md +137 -0
- package/docs/pages/guides/fonts-and-text.md +202 -0
- package/docs/pages/guides/images-and-vectors.md +219 -0
- package/docs/pages/guides/keep-the-page-responsive.md +81 -0
- package/docs/pages/guides/links-outlines-and-metadata.md +222 -0
- package/docs/pages/guides/password-protected-files.md +70 -0
- package/docs/pages/guides/save-a-pdf.md +144 -0
- package/docs/pages/guides/untrusted-files.md +80 -0
- package/docs/pages/index.md +33 -0
- package/docs/pages/install.md +75 -0
- package/docs/pages/quick-start/browser.md +67 -0
- package/docs/pages/quick-start/bun.md +60 -0
- package/docs/pages/quick-start/deno.md +58 -0
- package/docs/pages/quick-start/node.md +61 -0
- package/docs/pages/quick-start/rust.md +58 -0
- package/docs/pages/quick-start/workers.md +139 -0
- package/docs/pages/recipes/cloudflare-worker.md +115 -0
- package/docs/pages/recipes/extract-markdown.md +114 -0
- package/docs/pages/recipes/generate-then-edit.md +135 -0
- package/docs/pages/recipes/hello.md +94 -0
- package/docs/pages/recipes/images-and-vectors.md +209 -0
- package/docs/pages/recipes/invoice.md +226 -0
- package/docs/pages/recipes/links-and-outlines.md +215 -0
- package/docs/pages/recipes/multilingual.md +189 -0
- package/docs/pages/recipes/open-untrusted.md +65 -0
- package/docs/pages/recipes/pdf-a-archive.md +205 -0
- package/docs/pages/recipes/pdf-a3-invoice-with-xml.md +222 -0
- package/docs/pages/recipes/pdf-ua-report.md +237 -0
- package/docs/pages/recipes/report.md +125 -0
- package/docs/pages/recipes/web-worker-client.md +64 -0
- package/docs/pages/recipes.md +47 -0
- package/docs/pages/reference/changelog.md +86 -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 +77 -0
- package/docs/pages/troubleshooting.md +74 -0
- package/docs/renames.json +86 -0
- package/docs/schemas/error.schema.json +305 -0
- package/docs/schemas/renames.schema.json +29 -0
- package/package.json +5 -3
- package/schemas/error.schema.json +19 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "0.2.0-alpha.3"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
[**@laminapdf/sdk**](../README.md)
|
|
6
|
+
|
|
7
|
+
***
|
|
8
|
+
|
|
9
|
+
[@laminapdf/sdk](../README.md) / Matrix
|
|
10
|
+
|
|
11
|
+
# Variable: Matrix
|
|
12
|
+
|
|
13
|
+
> `const` **Matrix**: `object`
|
|
14
|
+
|
|
15
|
+
Building transformation matrices.
|
|
16
|
+
|
|
17
|
+
## Type Declaration
|
|
18
|
+
|
|
19
|
+
### identity
|
|
20
|
+
|
|
21
|
+
> `readonly` **identity**: [`Transform`](../type-aliases/Transform.md)
|
|
22
|
+
|
|
23
|
+
The identity.
|
|
24
|
+
|
|
25
|
+
### after()
|
|
26
|
+
|
|
27
|
+
> `readonly` **after**(`outer`, `inner`): [`Transform`](../type-aliases/Transform.md)
|
|
28
|
+
|
|
29
|
+
`outer` applied after `inner`: maps p to outer(inner(p)).
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### outer
|
|
34
|
+
|
|
35
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
36
|
+
|
|
37
|
+
##### inner
|
|
38
|
+
|
|
39
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
44
|
+
|
|
45
|
+
### rotate()
|
|
46
|
+
|
|
47
|
+
> `readonly` **rotate**(`degrees`): [`Transform`](../type-aliases/Transform.md)
|
|
48
|
+
|
|
49
|
+
A rotation by `degrees` about the origin, clockwise as displayed.
|
|
50
|
+
|
|
51
|
+
#### Parameters
|
|
52
|
+
|
|
53
|
+
##### degrees
|
|
54
|
+
|
|
55
|
+
`number`
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
60
|
+
|
|
61
|
+
### scale()
|
|
62
|
+
|
|
63
|
+
> `readonly` **scale**(`sx`, `sy`): [`Transform`](../type-aliases/Transform.md)
|
|
64
|
+
|
|
65
|
+
A scaling by `sx` horizontally and `sy` vertically.
|
|
66
|
+
|
|
67
|
+
#### Parameters
|
|
68
|
+
|
|
69
|
+
##### sx
|
|
70
|
+
|
|
71
|
+
`number`
|
|
72
|
+
|
|
73
|
+
##### sy
|
|
74
|
+
|
|
75
|
+
`number`
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
80
|
+
|
|
81
|
+
### translate()
|
|
82
|
+
|
|
83
|
+
> `readonly` **translate**(`x`, `y`): [`Transform`](../type-aliases/Transform.md)
|
|
84
|
+
|
|
85
|
+
A translation by (x, y) points.
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
##### x
|
|
90
|
+
|
|
91
|
+
`number`
|
|
92
|
+
|
|
93
|
+
##### y
|
|
94
|
+
|
|
95
|
+
`number`
|
|
96
|
+
|
|
97
|
+
#### Returns
|
|
98
|
+
|
|
99
|
+
[`Transform`](../type-aliases/Transform.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "0.2.0-alpha.3"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
[**@laminapdf/sdk**](../README.md)
|
|
6
|
+
|
|
7
|
+
***
|
|
8
|
+
|
|
9
|
+
[@laminapdf/sdk](../README.md) / PAGE\_SIZES
|
|
10
|
+
|
|
11
|
+
# Variable: PAGE\_SIZES
|
|
12
|
+
|
|
13
|
+
> `const` **PAGE\_SIZES**: `Readonly`\<`Record`\<[`PageSizeName`](../type-aliases/PageSizeName.md), readonly \[`width`: `number`, `height`: `number`\]\>\>
|
|
14
|
+
|
|
15
|
+
Each named size in points, width × height.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "0.2.0-alpha.3"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
[**@laminapdf/sdk**](../README.md)
|
|
6
|
+
|
|
7
|
+
***
|
|
8
|
+
|
|
9
|
+
[@laminapdf/sdk](../README.md) / TAG\_NAMES
|
|
10
|
+
|
|
11
|
+
# Variable: TAG\_NAMES
|
|
12
|
+
|
|
13
|
+
> `const` **TAG\_NAMES**: readonly \[`"Document"`, `"Part"`, `"Sect"`, `"H1"`, `"H2"`, `"H3"`, `"H4"`, `"H5"`, `"H6"`, `"P"`, `"L"`, `"LI"`, `"Lbl"`, `"LBody"`, `"Table"`, `"TR"`, `"TH"`, `"TD"`, `"Figure"`, `"Caption"`, `"Link"`, `"Span"`, `"Quote"`, `"Note"`, `"Code"`\]
|
|
14
|
+
|
|
15
|
+
Every TagName, as the WASM module names it.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Error and warning codes"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Error and warning codes
|
|
8
|
+
|
|
9
|
+
- [`aes-padding-invalid`](aes-padding-invalid.md)
|
|
10
|
+
- [`already-initialized`](already-initialized.md)
|
|
11
|
+
- [`binary-output-to-terminal`](binary-output-to-terminal.md)
|
|
12
|
+
- [`builder-finished`](builder-finished.md)
|
|
13
|
+
- [`cancelled`](cancelled.md)
|
|
14
|
+
- [`cmap-invalid`](cmap-invalid.md)
|
|
15
|
+
- [`collection-index`](collection-index.md)
|
|
16
|
+
- [`color-components`](color-components.md)
|
|
17
|
+
- [`content-bad-operands`](content-bad-operands.md)
|
|
18
|
+
- [`content-path-unpainted`](content-path-unpainted.md)
|
|
19
|
+
- [`content-resource-missing`](content-resource-missing.md)
|
|
20
|
+
- [`content-syntax`](content-syntax.md)
|
|
21
|
+
- [`content-unbalanced-bt`](content-unbalanced-bt.md)
|
|
22
|
+
- [`content-unbalanced-marked`](content-unbalanced-marked.md)
|
|
23
|
+
- [`content-unbalanced-q`](content-unbalanced-q.md)
|
|
24
|
+
- [`content-unknown-operator`](content-unknown-operator.md)
|
|
25
|
+
- [`data-pending`](data-pending.md)
|
|
26
|
+
- [`decompress`](decompress.md)
|
|
27
|
+
- [`device-color-without-output-intent`](device-color-without-output-intent.md)
|
|
28
|
+
- [`direct-page`](direct-page.md)
|
|
29
|
+
- [`disposed`](disposed.md)
|
|
30
|
+
- [`document-changed`](document-changed.md)
|
|
31
|
+
- [`embedded-file-forbidden`](embedded-file-forbidden.md)
|
|
32
|
+
- [`embedded-file-without-mime-type`](embedded-file-without-mime-type.md)
|
|
33
|
+
- [`encoding-full`](encoding-full.md)
|
|
34
|
+
- [`encrypted-base`](encrypted-base.md)
|
|
35
|
+
- [`extract-limit-blocks`](extract-limit-blocks.md)
|
|
36
|
+
- [`extract-module-not-loaded`](extract-module-not-loaded.md)
|
|
37
|
+
- [`extract-reading-order-ambiguous`](extract-reading-order-ambiguous.md)
|
|
38
|
+
- [`extract-struct-tree-ignored`](extract-struct-tree-ignored.md)
|
|
39
|
+
- [`extract-table-ambiguous`](extract-table-ambiguous.md)
|
|
40
|
+
- [`extract-table-limit`](extract-table-limit.md)
|
|
41
|
+
- [`extract-untagged-content`](extract-untagged-content.md)
|
|
42
|
+
- [`fetch-failed`](fetch-failed.md)
|
|
43
|
+
- [`flate-truncated`](flate-truncated.md)
|
|
44
|
+
- [`font-invalid`](font-invalid.md)
|
|
45
|
+
- [`font-mismatch`](font-mismatch.md)
|
|
46
|
+
- [`font-not-embeddable`](font-not-embeddable.md)
|
|
47
|
+
- [`font-not-embedded`](font-not-embedded.md)
|
|
48
|
+
- [`font-not-shapable`](font-not-shapable.md)
|
|
49
|
+
- [`glyph-out-of-range`](glyph-out-of-range.md)
|
|
50
|
+
- [`glyph-without-unicode`](glyph-without-unicode.md)
|
|
51
|
+
- [`heading-level-skipped`](heading-level-skipped.md)
|
|
52
|
+
- [`image-data-length`](image-data-length.md)
|
|
53
|
+
- [`image-too-large`](image-too-large.md)
|
|
54
|
+
- [`inline-image-unterminated`](inline-image-unterminated.md)
|
|
55
|
+
- [`input-unreadable`](input-unreadable.md)
|
|
56
|
+
- [`instance-reset`](instance-reset.md)
|
|
57
|
+
- [`invalid-argument`](invalid-argument.md)
|
|
58
|
+
- [`invalid-axis-value`](invalid-axis-value.md)
|
|
59
|
+
- [`invalid-box`](invalid-box.md)
|
|
60
|
+
- [`invalid-color`](invalid-color.md)
|
|
61
|
+
- [`invalid-command-line`](invalid-command-line.md)
|
|
62
|
+
- [`invalid-date`](invalid-date.md)
|
|
63
|
+
- [`invalid-entry`](invalid-entry.md)
|
|
64
|
+
- [`invalid-feature`](invalid-feature.md)
|
|
65
|
+
- [`invalid-font`](invalid-font.md)
|
|
66
|
+
- [`invalid-geometry`](invalid-geometry.md)
|
|
67
|
+
- [`invalid-icc-profile`](invalid-icc-profile.md)
|
|
68
|
+
- [`invalid-image`](invalid-image.md)
|
|
69
|
+
- [`invalid-op-log`](invalid-op-log.md)
|
|
70
|
+
- [`invalid-page-label`](invalid-page-label.md)
|
|
71
|
+
- [`invalid-page-labels`](invalid-page-labels.md)
|
|
72
|
+
- [`invalid-page-range`](invalid-page-range.md)
|
|
73
|
+
- [`invalid-rotate`](invalid-rotate.md)
|
|
74
|
+
- [`invalid-structure-nesting`](invalid-structure-nesting.md)
|
|
75
|
+
- [`invalid-structure`](invalid-structure.md)
|
|
76
|
+
- [`invalid-text-range`](invalid-text-range.md)
|
|
77
|
+
- [`job-finished`](job-finished.md)
|
|
78
|
+
- [`limit-exceeded`](limit-exceeded.md)
|
|
79
|
+
- [`link-without-contents`](link-without-contents.md)
|
|
80
|
+
- [`link-without-structure`](link-without-structure.md)
|
|
81
|
+
- [`missing-alt-text`](missing-alt-text.md)
|
|
82
|
+
- [`missing-glyph`](missing-glyph.md)
|
|
83
|
+
- [`missing-header`](missing-header.md)
|
|
84
|
+
- [`missing-lang`](missing-lang.md)
|
|
85
|
+
- [`missing-root`](missing-root.md)
|
|
86
|
+
- [`missing-title`](missing-title.md)
|
|
87
|
+
- [`name-tree-node-skipped`](name-tree-node-skipped.md)
|
|
88
|
+
- [`nested-transaction`](nested-transaction.md)
|
|
89
|
+
- [`no-pending-save`](no-pending-save.md)
|
|
90
|
+
- [`no-transaction`](no-transaction.md)
|
|
91
|
+
- [`not-initialized`](not-initialized.md)
|
|
92
|
+
- [`not-pdf`](not-pdf.md)
|
|
93
|
+
- [`not-rebased`](not-rebased.md)
|
|
94
|
+
- [`object-number-out-of-range`](object-number-out-of-range.md)
|
|
95
|
+
- [`objstm-index-mismatch`](objstm-index-mismatch.md)
|
|
96
|
+
- [`out-of-memory`](out-of-memory.md)
|
|
97
|
+
- [`outline-cycle`](outline-cycle.md)
|
|
98
|
+
- [`outline-item-skipped`](outline-item-skipped.md)
|
|
99
|
+
- [`output-unwritable`](output-unwritable.md)
|
|
100
|
+
- [`overwrite-refused`](overwrite-refused.md)
|
|
101
|
+
- [`page-count-mismatch`](page-count-mismatch.md)
|
|
102
|
+
- [`page-index-out-of-range`](page-index-out-of-range.md)
|
|
103
|
+
- [`page-tree-node-skipped`](page-tree-node-skipped.md)
|
|
104
|
+
- [`password-required`](password-required.md)
|
|
105
|
+
- [`path-outside-roots`](path-outside-roots.md)
|
|
106
|
+
- [`perms-mismatch`](perms-mismatch.md)
|
|
107
|
+
- [`profile-version-conflict`](profile-version-conflict.md)
|
|
108
|
+
- [`reference-cycle`](reference-cycle.md)
|
|
109
|
+
- [`render-backend-unavailable`](render-backend-unavailable.md)
|
|
110
|
+
- [`render-failed`](render-failed.md)
|
|
111
|
+
- [`render-too-large`](render-too-large.md)
|
|
112
|
+
- [`repaired-base`](repaired-base.md)
|
|
113
|
+
- [`requires-rewrite`](requires-rewrite.md)
|
|
114
|
+
- [`saved-not-rebased`](saved-not-rebased.md)
|
|
115
|
+
- [`sink-not-empty`](sink-not-empty.md)
|
|
116
|
+
- [`sink`](sink.md)
|
|
117
|
+
- [`source-budget-exceeded`](source-budget-exceeded.md)
|
|
118
|
+
- [`source-changed`](source-changed.md)
|
|
119
|
+
- [`source`](source.md)
|
|
120
|
+
- [`stale-generation`](stale-generation.md)
|
|
121
|
+
- [`stream-length-recovered`](stream-length-recovered.md)
|
|
122
|
+
- [`strict`](strict.md)
|
|
123
|
+
- [`subset-failed`](subset-failed.md)
|
|
124
|
+
- [`syntax`](syntax.md)
|
|
125
|
+
- [`text-module-not-loaded`](text-module-not-loaded.md)
|
|
126
|
+
- [`text-overflow`](text-overflow.md)
|
|
127
|
+
- [`tounicode-conflict`](tounicode-conflict.md)
|
|
128
|
+
- [`type`](type.md)
|
|
129
|
+
- [`unexpected-eof`](unexpected-eof.md)
|
|
130
|
+
- [`unknown-axis`](unknown-axis.md)
|
|
131
|
+
- [`unknown-code`](unknown-code.md)
|
|
132
|
+
- [`unknown-destination`](unknown-destination.md)
|
|
133
|
+
- [`unknown-font`](unknown-font.md)
|
|
134
|
+
- [`unknown-option`](unknown-option.md)
|
|
135
|
+
- [`unknown-page`](unknown-page.md)
|
|
136
|
+
- [`unmapped-glyph`](unmapped-glyph.md)
|
|
137
|
+
- [`unnumbered-heading-misused`](unnumbered-heading-misused.md)
|
|
138
|
+
- [`unset-object`](unset-object.md)
|
|
139
|
+
- [`unsupported-filter`](unsupported-filter.md)
|
|
140
|
+
- [`unsupported-image`](unsupported-image.md)
|
|
141
|
+
- [`unsupported-layout-option`](unsupported-layout-option.md)
|
|
142
|
+
- [`unsupported-security-handler`](unsupported-security-handler.md)
|
|
143
|
+
- [`unsupported-version`](unsupported-version.md)
|
|
144
|
+
- [`untagged-content`](untagged-content.md)
|
|
145
|
+
- [`warnings-truncated`](warnings-truncated.md)
|
|
146
|
+
- [`wasm-trap`](wasm-trap.md)
|
|
147
|
+
- [`whole-font-rebuilt`](whole-font-rebuilt.md)
|
|
148
|
+
- [`worker-crashed`](worker-crashed.md)
|
|
149
|
+
- [`worker-failed`](worker-failed.md)
|
|
150
|
+
- [`worker-version-mismatch`](worker-version-mismatch.md)
|
|
151
|
+
- [`would-invalidate-signatures`](would-invalidate-signatures.md)
|
|
152
|
+
- [`wrong-document`](wrong-document.md)
|
|
153
|
+
- [`wrong-password`](wrong-password.md)
|
|
154
|
+
- [`xobject-cycle`](xobject-cycle.md)
|
|
155
|
+
- [`xref-repaired`](xref-repaired.md)
|
|
156
|
+
- [`xrefstm-ignored`](xrefstm-ignored.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "aes-padding-invalid"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/aes-padding-invalid/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# aes-padding-invalid
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `security` (encryption, permissions or signatures block the call, or look tampered with)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
AES-encrypted data was not `IV ‖ whole blocks` or had invalid padding; it was kept as stored or unstripped.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Damaged data, or plaintext spliced into an encrypted file (PDFex-style).
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Treat the affected strings and streams as suspect: they may have been altered or spliced in. Don't use them for anything security-relevant.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
(an AESV2 string whose last block does not end in valid PKCS#5 padding)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Lamina PDF keeps the data as stored (or unstripped) instead of failing, and raises the warning with the string's or stream's `object`.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
None.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "already-initialized"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/already-initialized/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# already-initialized
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `state` (the call isn't valid in the object's current state)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`init()` or `loadText()` of `@laminapdf/sdk` named a source (a URL, `Response`, bytes or `WebAssembly.Module`) for a module that an earlier call had already loaded, or started loading, from another source (or from the default file).
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Each module is instantiated once per JavaScript realm: every document and builder lives in that instance. Loading a second copy from another source would leave two instances whose objects can't be mixed, so the second source is refused rather than silently ignored.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Pass the source on the first call only; later calls (from other parts of the app) can call `init()` without one, which waits for the same load. Calling again with the very same source object is allowed.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
await init(new URL("/wasm/lamina_pdf_base.wasm", location.href));
|
|
28
|
+
await init(); // fine: the module is loaded
|
|
29
|
+
await init(otherBytes); // throws { code: "already-initialized", … }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
None.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "binary-output-to-terminal"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/binary-output-to-terminal/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# binary-output-to-terminal
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A command that writes a PDF was told to write it to standard output (`-o -`), and standard output is a terminal.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A PDF's bytes would fill the terminal with noise and can leave it in a strange state. The CLI writes binary output only to a file or a pipe.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Redirect standard output to a file or a pipe, or write to a file with `-o`.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```console
|
|
27
|
+
$ laminapdf pages rotate scan.pdf +90 -o -
|
|
28
|
+
error[binary-output-to-terminal]: standard output is a terminal
|
|
29
|
+
= hint: redirect standard output to a file or a pipe, or write to a file with -o
|
|
30
|
+
$ laminapdf pages rotate scan.pdf +90 -o - > rotated.pdf
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Data fields
|
|
34
|
+
|
|
35
|
+
None.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "builder-finished"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/builder-finished/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# builder-finished
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `state` (the call isn't valid in the object's current state)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A `WasmBuilder` method was called after the builder's `finish`, or a `WasmPageBuilder` was drawn on or finished again after its own `finish` (or after its builder's).
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
`finish` hands the work over: a builder's becomes a `WasmDocument`, a page's is written into its builder. Neither holds anything to draw on afterwards.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Draw everything on a page before finishing it, and finish every page before the builder. To build more, create a new page or builder.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const b = new WasmBuilder(undefined);
|
|
28
|
+
const page = b.page(595, 842);
|
|
29
|
+
page.finish();
|
|
30
|
+
page.save(); // throws { code: "builder-finished", … }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Data fields
|
|
34
|
+
|
|
35
|
+
- `argument`: always `builder`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "cancelled"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/cancelled/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# cancelled
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `cancelled` (a `CancelToken` stopped the work)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
The `CancelToken` passed to a job, or to a run-to-completion call such as `Document::save`, was cancelled. The call returned at its next check: the start of a step, a budget check, or the next object or page of a long loop.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
The caller (or a host on its behalf: an `AbortSignal`, Ctrl-C, a task cancellation) asked for the work to stop.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing: this is the outcome that was asked for. The job is finished, a cancelled save left the document as it was (`Dirty`, nothing written), and a cancelled read returned no partial result. Start a new job with a fresh token to try again.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let cancel = laminapdf::CancelToken::new();
|
|
28
|
+
cancel.cancel();
|
|
29
|
+
let err = doc.save_with(&laminapdf::SaveOptions::new(), &cancel).unwrap_err();
|
|
30
|
+
assert_eq!(err.code(), "cancelled");
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Data fields
|
|
34
|
+
|
|
35
|
+
None.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "cmap-invalid"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/cmap-invalid/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# cmap-invalid
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A font's CMap (its Type 0 `/Encoding`) or ToUnicode CMap couldn't be fully used, for one of three reasons:
|
|
15
|
+
|
|
16
|
+
- entries that can't be read, which are skipped;
|
|
17
|
+
- a predefined CMap Lamina PDF has no table for, read as Identity (Lamina PDF knows only `Identity-H`/`-V` and the `Uni…-UCS2-…`/`Uni…-UTF16-…` ones);
|
|
18
|
+
- a `/UseCMap` chain deeper than 8 levels, cut there.
|
|
19
|
+
|
|
20
|
+
## Why
|
|
21
|
+
|
|
22
|
+
A producer bug (bad ranges, a missing `end…` keyword), or a CJK file using one of Adobe's character-collection CMaps without embedding it.
|
|
23
|
+
|
|
24
|
+
## How to fix
|
|
25
|
+
|
|
26
|
+
Nothing to do. The rest of the CMap is used; affected glyphs may extract as other text or U+FFFD.
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
1 beginbfchar
|
|
32
|
+
<0003> <0020
|
|
33
|
+
endbfchar
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The destination string is not closed; the entry is skipped, and the rest of the ToUnicode CMap is used.
|
|
37
|
+
|
|
38
|
+
## Data fields
|
|
39
|
+
|
|
40
|
+
None.
|
|
41
|
+
|
|
42
|
+
The `location` is `object`, the font dictionary's object; none for a direct font dictionary.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "collection-index"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/collection-index/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# collection-index
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`Font::from_collection` was asked for a member past the end of the font collection.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Members are numbered from 0; a single font counts as a collection of one.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Use an index below `Font::collection_len(bytes)`.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let font = Font::from_collection(ttc_bytes, 4)?; // the collection has 4 members (0..=3): collection-index
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Data fields
|
|
31
|
+
|
|
32
|
+
- `index`: the member that was asked for.
|
|
33
|
+
- `count`: how many members the collection has.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "color-components"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/color-components/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# color-components
|
|
8
|
+
|
|
9
|
+
- Type: error
|
|
10
|
+
- Kind: `usage` (the caller misused the API)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
`Color::icc` was given a number of components that differs from the profile's channel count.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
An `ICCBased` colour has one component per channel of its profile (`/N`: Gray 1, RGB and Lab 3, CMYK 4).
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Give `IccProfile::components()` values.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```rust
|
|
27
|
+
let c = Color::icc(&cmyk_profile, &[0.1, 0.2, 0.3])?; // color-components: 4 expected
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Data fields
|
|
31
|
+
|
|
32
|
+
- `expected`: the colour space's number of components.
|
|
33
|
+
- `actual`: how many were given.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "content-bad-operands"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/content-bad-operands/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# content-bad-operands
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
An operator had too few operands or operands of the wrong type (it was skipped), or extra operands (the last ones were used).
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A producer bug, or damaged content.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing to do.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
72 Td
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`Td` takes two numbers; with one, the operator is skipped.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `offset`: the operator's byte offset in the decoded content.
|
|
35
|
+
|
|
36
|
+
The `location` is `object` (the page for page content, the Form XObject for a form) with `streamOffset` in its decoded content; none for content interpreted on its own or a direct page.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "content-path-unpainted"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/content-path-unpainted/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# content-path-unpainted
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
A content stream ended with a path that no painting operator ended; it was dropped.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
A producer bug, or truncated content.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Nothing to do.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
0 0 m 100 100 l
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The content stream ends after building a path without `S`, `f` or `n`: the path is dropped, as the spec intends.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `offset`: the byte offset of the path's first segment in the decoded content.
|
|
35
|
+
|
|
36
|
+
The `location` is `object` (the page for page content, the Form XObject for a form) with `streamOffset` in its decoded content; none for content interpreted on its own or a direct page.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "content-resource-missing"
|
|
3
|
+
version: "0.2.0-alpha.3"
|
|
4
|
+
url: "https://docs.laminapdf.com/reference/codes/content-resource-missing/"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# content-resource-missing
|
|
8
|
+
|
|
9
|
+
- Type: warning
|
|
10
|
+
- Kind: `input` (the input is malformed beyond what tolerance repairs)
|
|
11
|
+
|
|
12
|
+
## What happened
|
|
13
|
+
|
|
14
|
+
An operator named a resource (font, XObject, graphics state, colour space, shading, property list) that is missing, of the wrong type or unreadable, or a Form XObject's content could not be decoded; the operator was skipped or ran without it.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
Resources lost in editing or merging, or damaged objects.
|
|
19
|
+
|
|
20
|
+
## How to fix
|
|
21
|
+
|
|
22
|
+
Check the page's `/Resources`.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
/Im7 Do % /Resources << /XObject << /Im1 8 0 R >> >>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`/Im7` is not in the page's resources, so the `Do` draws nothing. `data.category` is `XObject`; the resource's name, which comes from the file, is never put in the message.
|
|
31
|
+
|
|
32
|
+
## Data fields
|
|
33
|
+
|
|
34
|
+
- `offset`: the operator's byte offset in the decoded content.
|
|
35
|
+
- `category`: the resource category, e.g. `Font` (Lamina PDF's own vocabulary).
|
|
36
|
+
|
|
37
|
+
The `location` is `object` (the page for page content, the Form XObject for a form) with `streamOffset` in its decoded content; none for content interpreted on its own or a direct page.
|