- Root and barrel exports have been removed
- consumers must import modules via subpath entry points (e.g.
@denkiyagi/pdf-lib/api/PDFDocument.js) main/module/typesinpackage.jsonare no longer published; onlyexportsmap is used
- consumers must import modules via subpath entry points (e.g.
- Remove legacy dependencies
tslib,ts-patch, andtypescript-transform-paths
- Native ESM everywhere: all src/tests/apps use
.js-suffixed local imports; Jest replaced with vitest; CJS build removed. - Build outputs relocated to
dist/:dist/es(native ESM + typings) anddist/umd(bundled). - Package now uses conditional exports; consumers must import via the published entry points (
import/exportsmap) rather than deep-linking files.
- Switched PNG decoding from
@pdf-lib/upngtofast-png, preventing freezes on truncated PNG inputs. - Animated PNGs are now accepted and decoded as a single image.
- (removed)
- (removed)
- Remove WOFF/WOFF2/DFont support from
PDFDocument#embedFontby updating@denkiyagi/fontkitto2.0.4-mod.2025.4; only*.ttfand*.otffont formats are now supported. - Remove Base64 string/dataURI inputs across
PDFDocumentloading, embedding, and attachments; binary data must now be provided asUint8ArrayorArrayBuffer. - Remove Base64 output by removing the
PDFDocument#saveAsBase64method; usePDFDocument#savewhich resolves aUint8Arrayinstead.
- Introduced
PDFLibError(exported fromsrc/core) with a machine-readabletype: PDFLibErrorTypeto classify errors. - Refactored API/core/utils errors so that all errors extend
PDFLibErrorinstead of throwing bareError/TypeError. - Normalize external failure surfaces by catching
@denkiyagi/fontkitand@pdf-lib/upngexceptions and rethrowing correspondingPDFLibErrorsubclasses (e.g.,InvalidFontDataError) instead of leaking third-party errors.
- Update several devDependencies including
typescriptto their latest versions.
- Add
PDFDocument#embedTTFFont(subset-only) andCustomFontSubsetEmbedder.forTTFFontso pre-created fontkitTTFFontinstances can be embedded. - Refactor the internal custom font embedders into separate subset and non-subset implementations by adding the abstract base class
AbstractCustomFontEmbedder.
- Update
@denkiyagi/fontkitto2.0.4-mod.2025.2, which enhances runtime performance for Unicode Variation Sequences (UVS) support.
- Update
@denkiyagi/fontkitto2.0.4-mod.2025.1, which improves Unicode Variation Sequences (UVS) support.
- Changed npm dependency
fontkitto@denkiyagi/fontkit - Improved
optionsparameter ofPDFDocument#embedFont - Fix
AbstractCustomFontEmbedder#embedCIDFontDictso that it respects glyph metrics when embedding vertical fonts - Add methods
PDFFont#getRawStandardFontandPDFFont#getRawCustomFont - Improve parameters of
PDFPage#drawText:- Expand the data type of the
textparameter so that it also accepts Glyph IDs instead of string - Add
fontLayoutAdvancedParamsproperty to theoptionsparameter
- Expand the data type of the
- (removed)
- Upgraded
crypto-js
- (removed)
- Added border-radius options to
PDFPage#drawRectangle()
- Added encryption feature:
PDFDocument#encrypt() - Changed the property
PDFDocument#isEncryptedto a method as it is dynamic now. - Enabled to create/update the document ID:
PDFDocument#updateId()
- (removed)
- Used
fontkit 2instead of@pdf-lib/fontkit.- Removed
PDFDocument#registerFontkit().fontkitis included by default.
- Removed
- Added vertical text option.
- Removed support for deno and react-native.
- Upgraded TypeScript version to 4.9.
- Used
import typeand removedexport defaultfrom internal packages.
- Used