[PR #2441] [MERGED] fix: flatten pdf-lib form fields before sealing document #2307

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2441
Author: @Mythie
Created: 2/3/2026
Status: Merged
Merged: 2/3/2026
Merged by: @dguyen

Base: mainHead: fix/checkbox-appearance-flattening


📝 Commits (1)

  • b22f2b2 fix: flatten pdf-lib form fields before sealing document

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 packages/lib/jobs/definitions/internal/seal-document.handler.ts (+4 -0)

📄 Description

Summary

  • Fixes checkbox fields not displaying correctly in sealed documents by calling flatten() on the pdf-lib form before saving
  • This ensures checkbox appearances are correctly generated at flatten time rather than relying on viewer rendering

Problem

Checkboxes weren't flattening correctly because pdf-lib wasn't generating the correct appearances until flatten time. Without explicitly calling flatten(), the checkbox visual state wasn't being baked into the PDF.

Solution

Added a flatten() call on the pdf-lib form after all fields are populated, ensuring appearances are properly generated before the document is saved and sealed.


🔄 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/2441 **Author:** [@Mythie](https://github.com/Mythie) **Created:** 2/3/2026 **Status:** ✅ Merged **Merged:** 2/3/2026 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `fix/checkbox-appearance-flattening` --- ### 📝 Commits (1) - [`b22f2b2`](https://github.com/documenso/documenso/commit/b22f2b2dcb80b5409ca04257484835bbc956bf17) fix: flatten pdf-lib form fields before sealing document ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/jobs/definitions/internal/seal-document.handler.ts` (+4 -0) </details> ### 📄 Description ## Summary - Fixes checkbox fields not displaying correctly in sealed documents by calling `flatten()` on the pdf-lib form before saving - This ensures checkbox appearances are correctly generated at flatten time rather than relying on viewer rendering ## Problem Checkboxes weren't flattening correctly because pdf-lib wasn't generating the correct appearances until flatten time. Without explicitly calling `flatten()`, the checkbox visual state wasn't being baked into the PDF. ## Solution Added a `flatten()` call on the pdf-lib form after all fields are populated, ensuring appearances are properly generated before the document is saved and sealed. --- <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:19 +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#2307
No description provided.