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::saveno longer takes aCancelToken. To stop a save from another thread, callsave_with(&options, &cancel)instead. In TypeScript,save(),saveWithReport()andSaveJob.step()now returnUint8Array<ArrayBuffer>, whichResponseandBlobaccept without a cast. Smaller additions:RectPt::from_points(x, y, width, height),SetInfo::patch(patch)for an edit that records no/ModDate, andnew()onBuildOptions,OpenOptions,PngOptions,RetryOptionsandTextBoxOptions. You can now ignore the run thatSurface::textreturns: the text is drawn either way.- The WASM module’s
beginTagandbeginArtifactnow take a structure type, table scope and artifact kind by name instead of by index, which breaks code that calls the module directly;@laminapdf/sdkalready calls them that way.@laminapdf/sdkalso exports theLineCap,LineJoinandTableScopetypes thatStrokeStyleandTagSpecuse, andlaminapdf-build’sFillRule,LineCap,LineJoin,BlendMode,ArtifactKindandTableScopegain anALLlist 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, andlaminapdf-syntaxaddsObject::numberandObject::rounded.
0.2.0-alpha.1
Minor Changes
- The library is called Lamina PDF, and its public names follow.
@laminapdf/sdk’s error class isLaminaPdfError, checked withisLaminaPdfError, and its warnings areLaminaPdfWarning. The error object’s JSON Schema islaminapdf.error/1.@laminapdf/wasm’s modules arelamina_pdf_base,lamina_pdf_text,lamina_pdf_extractandlamina_pdf_render_hayro(.js,.d.tsand.wasm). @laminapdf/viewerexports only its documented API:ViewerClient,createViewerandViewer, the types of their options, events and state, the protocol typesclient.calltakes, andMIN_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’sserve()takes asaveBudget(work units per save step), andworkerStats()reports the handles and calls a worker holds.@laminapdf/sdk/workerexports theEmitterits client uses.- A render
data-pendingthrown inside@laminapdf/sdk’s worker now reaches the page with its byte ranges:LaminaPdfError.rangeslists them. Before, they arrived empty.RenderErrorhas a newtoDiagnostic(), 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’stoJSON(),reviveRenderErrorandSerializedRenderErrorare gone, andByteRangeandRenderErrorKindname its types. The viewer’s worker now throwsRenderErrors forcancelledanddisposedinstead of plain objects, so they reach the page with adocsUrl. @laminapdf/renderhas oneWasmSourcetype for where an engine’s.wasmcomes from (a URL, aResponseor a promise of one, the bytes or a compiled module).CloneableWasmSourceis the subset a Web Worker can be sent.initPdfiumandinitHayroboth take it:@laminapdf/render-pdfium’s ownPdfiumWasmtype is gone, andinitHayrono longer takes aRequest, a promise of anything but aResponse, or a view of aSharedArrayBuffer.RenderBackenddeclaresmemory(), 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
rotatePageop now reads a/Rotatestored as an integral real, such as90.0, as the rotation the page displays; before, it read 0.PageBuilder.rotatenow refuses angles other than 0, 90, 180 and 270, as its type says. In the Rust crates,Rotationfromlaminapdf-syntaxreplaceslaminapdf-render’sViewRotationand the degrees inRenderPage::rotate, andlaminapdf_cos::Pagedropsmedia_box,crop_boxandrotate: read them, and their strict-mode errors, fromlaminapdf-model’s page view.
0.2.0-alpha.0
Minor Changes
- Accessible and archival PDFs. A
profilesoption on the builder (PDF/UA-1,PDF/A-2b,PDF/A-2u,PDF/A-3b;BuildOptions::with_profilein 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-typeandprofile-version-conflict. The builder writes the XMP identification,/DisplayDocTitlefor 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/workercan be extended:@laminapdf/sdk/worker/server’sserve({ methods })adds methods to the same worker, called withclient.request(method, params, { priority, key }). The worker runs higher priorities first and coalesces calls with the same key.emit()sends events toclient.on("event"), andconnect({ 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). Thelaminafaç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/sdkover the base, text and extract WebAssembly modules in browsers, Node, Deno, Bun and Cloudflare Workers.