Skip to content
Lamina PDF
Unreleased

These docs describe changes that aren’t released yet. For the newest release, see the released docs.

Changelog

Every Lamina PDF package shares one version, so each entry covers all of them, from the Rust crates to @laminapdf/sdk and the viewer. Breaking changes come first, under Minor Changes, as the stability policy explains. Versions from 0.2.0-alpha.2 on are on npm and crates.io; earlier ones were never published.

0.2.0-alpha.2

Minor Changes

  • Document::save no longer takes a CancelToken. To stop a save from another thread, call save_with(&options, &cancel) instead. In TypeScript, save(), saveWithReport() and SaveJob.step() now return Uint8Array<ArrayBuffer>, which Response and Blob accept without a cast. Smaller additions: RectPt::from_points(x, y, width, height), SetInfo::patch(patch) for an edit that records no /ModDate, and new() on BuildOptions, OpenOptions, PngOptions, RetryOptions and TextBoxOptions. You can now ignore the run that Surface::text returns: the text is drawn either way.
  • The WASM module’s beginTag and beginArtifact now take a structure type, table scope and artifact kind by name instead of by index, which breaks code that calls the module directly; @laminapdf/sdk already calls them that way. @laminapdf/sdk also exports the LineCap, LineJoin and TableScope types that StrokeStyle and TagSpec use, and laminapdf-build’s FillRule, LineCap, LineJoin, BlendMode, ArtifactKind and TableScope gain an ALL list of their variants.

Patch Changes

  • Text copied from a standard 14 font no longer loses half of its last character when that text runs past 256 UTF-16 units and ends with a character outside the BMP, such as an emoji. Symbol and ZapfDingbats now write a /CapHeight, as every other font does, and laminapdf-syntax adds Object::number and Object::rounded.

0.2.0-alpha.1

Minor Changes

  • The library is called Lamina PDF, and its public names follow. @laminapdf/sdk’s error class is LaminaPdfError, checked with isLaminaPdfError, and its warnings are LaminaPdfWarning. The error object’s JSON Schema is laminapdf.error/1. @laminapdf/wasm’s modules are lamina_pdf_base, lamina_pdf_text, lamina_pdf_extract and lamina_pdf_render_hayro (.js, .d.ts and .wasm).
  • @laminapdf/viewer exports only its documented API: ViewerClient, createViewer and Viewer, the types of their options, events and state, the protocol types client.call takes, and MIN_ZOOM/MAX_ZOOM. Its internal helpers (layout, canvas pool, bitmap cache, tiles, zoom maths), its byte-source functions and its protocol constants are no longer exported. Its worker no longer keeps a log of every render, which grew without bound, and no longer serves test-only methods. @laminapdf/sdk/worker/server’s serve() takes a saveBudget (work units per save step), and workerStats() reports the handles and calls a worker holds. @laminapdf/sdk/worker exports the Emitter its client uses.
  • A render data-pending thrown inside @laminapdf/sdk’s worker now reaches the page with its byte ranges: LaminaPdfError.ranges lists them. Before, they arrived empty. RenderError has a new toDiagnostic(), which returns the plain error object every Lamina PDF surface uses, and the worker posts that object for any error that has the method. RenderError’s toJSON(), reviveRenderError and SerializedRenderError are gone, and ByteRange and RenderErrorKind name its types. The viewer’s worker now throws RenderErrors for cancelled and disposed instead of plain objects, so they reach the page with a docsUrl.
  • @laminapdf/render has one WasmSource type for where an engine’s .wasm comes from (a URL, a Response or a promise of one, the bytes or a compiled module). CloneableWasmSource is the subset a Web Worker can be sent. initPdfium and initHayro both take it: @laminapdf/render-pdfium’s own PdfiumWasm type is gone, and initHayro no longer takes a Request, a promise of anything but a Response, or a view of a SharedArrayBuffer. RenderBackend declares memory(), which both backends already had; a backend written outside this repository has to add it. The adapters share the page-index check, the read handling and the pending-range merging, so hayro now reports adjacent missing reads as one range, as PDFium did.
  • The rotatePage op now reads a /Rotate stored as an integral real, such as 90.0, as the rotation the page displays; before, it read 0. PageBuilder.rotate now refuses angles other than 0, 90, 180 and 270, as its type says. In the Rust crates, Rotation from laminapdf-syntax replaces laminapdf-render’s ViewRotation and the degrees in RenderPage::rotate, and laminapdf_cos::Page drops media_box, crop_box and rotate: read them, and their strict-mode errors, from laminapdf-model’s page view.

0.2.0-alpha.0

Minor Changes

  • Accessible and archival PDFs. A profiles option on the builder (PDF/UA-1, PDF/A-2b, PDF/A-2u, PDF/A-3b; BuildOptions::with_profile in Rust) checks each machine-checkable rule the document breaks when it finishes, with a coded error per rule: missing-title, missing-lang, untagged-content, missing-alt-text, heading-level-skipped, unnumbered-heading-misused, invalid-structure-nesting, link-without-structure, link-without-contents, font-not-embedded, glyph-without-unicode, device-color-without-output-intent, embedded-file-forbidden, embedded-file-without-mime-type and profile-version-conflict. The builder writes the XMP identification, /DisplayDocTitle for PDF/UA-1 and, for PDF/A, an sRGB output intent with a 480-byte embedded ICC profile. attach(name, bytes, mime, { relationship }) adds associated files for PDF/A-3b, such as an e-invoice’s XML. Every example that claims a profile is validated by veraPDF each night.
  • @laminapdf/sdk/worker can be extended: @laminapdf/sdk/worker/server’s serve({ methods }) adds methods to the same worker, called with client.request(method, params, { priority, key }). The worker runs higher priorities first and coalesces calls with the same key. emit() sends events to client.on("event"), and connect({ onDiscard }) sees late answers (by default it closes their ImageBitmaps). The worker protocol is now version 2.

0.1.0-alpha.0

Minor Changes

  • First alpha, 0.1.0-alpha.0, versioned and tagged but not published (ADR 0017). The lamina façade and its core crates at the same version: open, read, edit and save PDFs (incremental and full rewrites, the save planner, undo/redo), generate them (pages, vectors, colour, images, standard 14 and embedded fonts with shaping, bidi and line breaking, links, outlines, metadata, tagged PDF), and extract page text; @laminapdf/sdk over the base, text and extract WebAssembly modules in browsers, Node, Deno, Bun and Cloudflare Workers.