talira

Compare

@cantoo/pdf-libPDFKit@pdfme/pdf-libpdf-lib
What it isAn actively maintained fork of pdf-lib: create and modify PDF documents in any JavaScript environmentA JavaScript PDF generation library for Node and the browser.This version is forked from Hopding/pdf-lib, with several bug fixes and additional featuresCreate and modify PDF documents in any JavaScript environment.
KindOpen sourceOpen sourceOpen sourceOpen source
Trust0.480.700.670.14
Stars3641073350868678
Last commit2026-11-182026-11-032026-11-202024-07-17
LicenceMITMITMITMIT
PricingFree and open sourceFree and open sourceFree and open sourceFree and open source
Free tierYesYesYesYes
Self-hostableYesYesYesYes
Ways to run it————
SOC 2————
HIPAA————
SSO————
API—No—No
Plugins—No—No
MCP server—No—No
CompanyCantoofoliojspdfme—
Features
  • pdf-lib's API and docs: create and modify PDFs, add, remove, copy and merge pages
  • create, fill, read and flatten AcroForm fields; flatten() also flattens orphaned widget annotations
  • open encrypted PDFs with a password; encrypt() with AES-256 (default), AES-128 or RC4
  • incremental updates: append changes without rewriting the file
  • full SVG drawing (drawSvg, embedSvg) as well as SVG paths
  • PDFPage.extractContents(): text, images and approximate vector graphics from content streams
  • XFA helpers: preserveXFA, read and modify XFA JavaScript, signature-field discovery
  • document-level JavaScript extraction
  • All 15 features
  • Canvas-like vector graphics API with SVG path parsing, transforms and gradients
  • Text wrapping, alignment, soft hyphens and bulleted lists
  • Tables
  • Font embedding and subsetting (TrueType, OpenType, WOFF, WOFF2, collections)
  • JPEG and PNG images, including transparency
  • Annotations: links, notes, highlights, underlines
  • AcroForms
  • Outlines (bookmarks)
  • All 10 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
  • Create PDFs from scratch or modify existing ones
  • Draw text, images and SVG paths
  • Embed TrueType/OpenType fonts and PNG/JPEG images; measure text
  • Embed and draw pages from other PDFs
  • Add, insert, remove, split and merge pages
  • Create, fill, read and flatten AcroForm fields (text, checkbox, radio, dropdown, option list)
  • File attachments and document metadata
  • No native dependencies
Limitations
  • Doesn't extract plain text from a page outside form fields: it reads the values of text fields only
  • Doesn't add HTML or CSS content to a PDF: its README points to Puppeteer for that
  • Doesn't handle dynamic XFA forms: its XFA helpers target static government and tax XFA layouts
  • Doesn't make files fully PDF/A compliant: convertToPDFA() adds the structure but doesn't rewrite fonts, transparency or JavaScript
      • Doesn't open or edit encrypted PDFs: PDFDocument.load throws an EncryptedPDFError
      • Doesn't extract plain text from a page outside form fields: it reads the values of text fields only