# @pdfme/pdf-lib

> This version is forked from Hopding/pdf-lib, with several bug fixes and additional features

Source: https://talira.ai/catalog/pdfme-pdf-lib-zn1g1rkg
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [documents / pdf / manipulation](https://talira.ai/categories/documents/pdf/manipulation), [documents / pdf / forms](https://talira.ai/categories/documents/pdf/forms), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Self-hostable: yes[^2]
- Backed by: [pdfme](https://talira.ai/orgs/pdfme.md)
- Forked from [pdf-lib](https://talira.ai/catalog/pdf-lib-80dtat8x.md) in 2023. pdfme forked pdf-lib to carry the bug fixes and features its PDF generator and designer need

@pdfme/pdf-lib is the fork of [pdf-lib](https://talira.ai/catalog/pdf-lib-80dtat8x.md) that pdfme, an open source PDF generator and template designer, keeps in its monorepo and publishes with each pdfme release. It keeps pdf-lib's API, including the AcroForm classes for filling and flattening form fields, and adds the fixes pdfme needed: rounded-corner rectangles, full SVG drawing taken from [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md), and support for fontkit v2, which fixed garbled subsets of some Japanese and Chinese fonts. It's MIT licensed.

## Links

- Website: https://github.com/pdfme/pdfme/tree/main/packages/pdf-lib
- GitHub: https://github.com/pdfme/pdfme
- Docs: https://github.com/pdfme/pdfme/tree/main/packages/pdf-lib#readme

## Problems it solves

- draw rectangles with rounded corners on a PDF page from JavaScript
- Japanese and Chinese text comes out garbled when I subset the font I embed in a PDF
- use fontkit v2 instead of @pdf-lib/fontkit to embed fonts in a PDF
- a pdf-lib build that still gets releases, without changing my code's imports beyond the package name

## Features

- pdf-lib's API: create and modify PDFs, pages, fonts, images
- AcroForm classes: PDFForm, PDFTextField, PDFCheckBox, PDFDropdown, PDFRadioGroup, flatten()
- radius option on drawRectangle for rounded corners
- drawSvg from @cantoo/pdf-lib
- works with foliojs/fontkit v2
- released with pdfme's versions

## Trust

Overall: 0.67 out of 1.
Signals: maintenance 1.00, adoption 0.74, momentum 0.58, community 0.71, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 152 commits in the last 90 days
- latest release 6.2.8 34 days ago
- 5.1k GitHub stars
- 60 contributors
- accepts sponsorship (Github, Open Collective)
- backed by pdfme

## What this fork adds

- Adds a radius option to drawRectangle for rounded corners (not offered upstream)
- Brings in @cantoo/pdf-lib's drawSvg so whole SVG images can be drawn on a page (not offered upstream)
- Works with foliojs/fontkit v2, fixing garbled subsets of some Japanese and Chinese fonts (not offered upstream)

## Alternatives

- [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md): An actively maintained fork of pdf-lib: create and modify PDF documents in any JavaScript environment
- [pdf-lib](https://talira.ai/catalog/pdf-lib-80dtat8x.md): Create and modify PDF documents in any JavaScript environment.

## Sources

[^1]: https://github.com/pdfme/pdfme/blob/main/packages/pdf-lib/LICENSE.md (checked 20 Nov 2026)
[^2]: https://github.com/pdfme/pdfme/tree/main/packages/pdf-lib (checked 20 Nov 2026)
