[PR #2403] [MERGED] refactor: replace pdf-sign with libpdf/core for PDF operations #2276

Closed
opened 2026-02-26 20:33:12 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2403
Author: @Mythie
Created: 1/21/2026
Status: Merged
Merged: 1/21/2026
Merged by: @Mythie

Base: mainHead: feat/swap-to-libpdf


📝 Commits (1)

  • e1858c3 refactor: replace pdf-sign with libpdf/core for PDF operation

📊 Changes

37 files changed (+1064 additions, -1467 deletions)

View changed files

📝 .env.example (+12 -0)
📝 apps/documentation/pages/developers/self-hosting/how-to.mdx (+4 -1)
📝 apps/documentation/pages/developers/self-hosting/signing-certificate.mdx (+16 -10)
📝 apps/remix/example/cert.p12 (+0 -0)
📝 docker/README.md (+60 -50)
📝 package-lock.json (+566 -416)
📝 package.json (+2 -1)
📝 packages/app-tests/e2e/features/include-document-certificate.spec.ts (+7 -7)
📝 packages/app-tests/e2e/scenarios/form-flattening.spec.ts (+25 -15)
📝 packages/lib/constants/app.ts (+9 -0)
📝 packages/lib/jobs/definitions/internal/seal-document.handler.ts (+63 -102)
📝 packages/lib/server-only/pdf/add-rejection-stamp-to-pdf.ts (+37 -53)
packages/lib/server-only/pdf/flatten-annotations.ts (+0 -63)
packages/lib/server-only/pdf/flatten-form.ts (+0 -170)
📝 packages/lib/server-only/pdf/generate-audit-log-pdf.ts (+4 -2)
📝 packages/lib/server-only/pdf/generate-certificate-pdf.ts (+2 -14)
📝 packages/lib/server-only/pdf/insert-form-values-in-pdf.ts (+8 -43)
packages/lib/server-only/pdf/insert-image-in-pdf.ts (+0 -26)
packages/lib/server-only/pdf/insert-text-in-pdf.ts (+0 -54)
📝 packages/lib/server-only/pdf/normalize-pdf.ts (+8 -8)

...and 17 more files

📄 Description

Migrate from @documenso/pdf-sign and @cantoo/pdf-lib to @libpdf/core
for all PDF manipulation and signing operations. This includes:

  • New signing transports for Google Cloud KMS and local certificates
  • Consolidated PDF operations using libpdf API
  • Added TSA (timestamp authority) helper for digital signatures
  • Removed deprecated flatten and insert utilities
  • Updated tests to use new PDF library

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2403 **Author:** [@Mythie](https://github.com/Mythie) **Created:** 1/21/2026 **Status:** ✅ Merged **Merged:** 1/21/2026 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/swap-to-libpdf` --- ### 📝 Commits (1) - [`e1858c3`](https://github.com/documenso/documenso/commit/e1858c32850e8802cc8eface156206d8535391ed) refactor: replace pdf-sign with libpdf/core for PDF operation ### 📊 Changes **37 files changed** (+1064 additions, -1467 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+12 -0) 📝 `apps/documentation/pages/developers/self-hosting/how-to.mdx` (+4 -1) 📝 `apps/documentation/pages/developers/self-hosting/signing-certificate.mdx` (+16 -10) 📝 `apps/remix/example/cert.p12` (+0 -0) 📝 `docker/README.md` (+60 -50) 📝 `package-lock.json` (+566 -416) 📝 `package.json` (+2 -1) 📝 `packages/app-tests/e2e/features/include-document-certificate.spec.ts` (+7 -7) 📝 `packages/app-tests/e2e/scenarios/form-flattening.spec.ts` (+25 -15) 📝 `packages/lib/constants/app.ts` (+9 -0) 📝 `packages/lib/jobs/definitions/internal/seal-document.handler.ts` (+63 -102) 📝 `packages/lib/server-only/pdf/add-rejection-stamp-to-pdf.ts` (+37 -53) ➖ `packages/lib/server-only/pdf/flatten-annotations.ts` (+0 -63) ➖ `packages/lib/server-only/pdf/flatten-form.ts` (+0 -170) 📝 `packages/lib/server-only/pdf/generate-audit-log-pdf.ts` (+4 -2) 📝 `packages/lib/server-only/pdf/generate-certificate-pdf.ts` (+2 -14) 📝 `packages/lib/server-only/pdf/insert-form-values-in-pdf.ts` (+8 -43) ➖ `packages/lib/server-only/pdf/insert-image-in-pdf.ts` (+0 -26) ➖ `packages/lib/server-only/pdf/insert-text-in-pdf.ts` (+0 -54) 📝 `packages/lib/server-only/pdf/normalize-pdf.ts` (+8 -8) _...and 17 more files_ </details> ### 📄 Description Migrate from @documenso/pdf-sign and @cantoo/pdf-lib to @libpdf/core for all PDF manipulation and signing operations. This includes: - New signing transports for Google Cloud KMS and local certificates - Consolidated PDF operations using libpdf API - Added TSA (timestamp authority) helper for digital signatures - Removed deprecated flatten and insert utilities - Updated tests to use new PDF library --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:33:12 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2276
No description provided.