[PR #2322] feat: document file conversion #2214

Open
opened 2026-02-26 20:32:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2322
Author: @ephraimduncan
Created: 12/15/2025
Status: 🔄 Open

Base: mainHead: feat/document-file-conversion


📝 Commits (10+)

📊 Changes

38 files changed (+417 additions, -101 deletions)

View changed files

📝 apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx (+18 -5)
📝 apps/remix/app/components/general/envelope/envelope-upload-button.tsx (+13 -0)
📝 apps/remix/server/api/files/files.helpers.ts (+30 -6)
📝 apps/remix/server/api/files/files.ts (+1 -1)
assets/test-document.docx (+0 -0)
assets/test-image.jpg (+0 -0)
assets/test-image.png (+0 -0)
📝 docker/development/compose.yml (+9 -0)
📝 packages/api/v1/implementation.ts (+5 -3)
📝 packages/app-tests/e2e/folders/team-account-folders.spec.ts (+6 -3)
📝 packages/lib/client-only/download-pdf.ts (+36 -5)
packages/lib/constants/upload.ts (+23 -0)
📝 packages/lib/server-only/document-data/create-document-data.ts (+10 -1)
📝 packages/lib/server-only/document/get-document-by-access-token.ts (+2 -0)
📝 packages/lib/server-only/document/send-document.ts (+7 -3)
📝 packages/lib/server-only/envelope/duplicate-envelope.ts (+1 -0)
packages/lib/server-only/file-conversion/convert-to-pdf.ts (+50 -0)
packages/lib/server-only/gotenberg/gotenberg-client.ts (+81 -0)
📝 packages/lib/server-only/template/create-document-from-template.ts (+5 -3)
📝 packages/lib/types/document.ts (+1 -0)

...and 18 more files

📄 Description

Description

Enable uploads of DOCX/JPEG/PNG by converting to PDF via Gotenberg while preserving the original file for download, and update UI messaging/validation and download handling accordingly.

Changes Made

  • Added upload constants/allowlist and Gotenberg config; added server-side conversion for non-PDF uploads in document/envelope creation with new conversion error handling.
  • Persisted original source files and MIME types on DocumentData with Prisma migrations; updated API queries/types to expose originalMimeType/originalData.
  • Updated file serving/downloading to return the original file when requested and to honor Content-Disposition filenames.
  • Updated upload UI/dropzones to accept PDF/DOCX/JPEG/PNG and refreshed error copy; added Gotenberg to dev compose and new test assets; adjusted an E2E upload step.

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Demo - Side by Side. Document in Microsoft Word and Signed in Documenso

Screenshot 2026-01-06 at 8 28 04 PM (2)

Demo Files

Original Docx File

Docx File Signed on Documenso


🔄 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/2322 **Author:** [@ephraimduncan](https://github.com/ephraimduncan) **Created:** 12/15/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/document-file-conversion` --- ### 📝 Commits (10+) - [`7a49927`](https://github.com/documenso/documenso/commit/7a499270beefd71cec3a0c201d422172ae27ef20) feat: document file conversion - [`3976531`](https://github.com/documenso/documenso/commit/39765310452e540a4c3d3bdadf5361a08451d50a) chore: fix merge conflicts - [`74db3d7`](https://github.com/documenso/documenso/commit/74db3d7a1c316d00d295d053e39c5d9bd5a12534) feat: add document file conversion - [`8a4205d`](https://github.com/documenso/documenso/commit/8a4205d808f7a6b42271e7399f11c40eec10448c) fix: build errors - [`64e0695`](https://github.com/documenso/documenso/commit/64e0695811f9cf3dc149a197d63767214079b644) fix: translations - [`b1763e4`](https://github.com/documenso/documenso/commit/b1763e422cee02e17f7773c974a0dfd07c33b9b9) fix: tests - [`f4cfa71`](https://github.com/documenso/documenso/commit/f4cfa71379209724460ccd4830de827a48a43d08) fix: tests - [`d4bee4a`](https://github.com/documenso/documenso/commit/d4bee4aed1c0bbef75fb1ab68e32781cbea31773) fix: tests - [`02ff8df`](https://github.com/documenso/documenso/commit/02ff8df09ba8033ef7ea2006ba73f5e0f69c9ccf) chore: remove tests - temp - [`665a0d0`](https://github.com/documenso/documenso/commit/665a0d0ea0ca3845f6ff0b665d5a657b50e1a29a) Merge branch 'main' into feat/document-file-conversion ### 📊 Changes **38 files changed** (+417 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `apps/remix/app/components/general/envelope/envelope-drop-zone-wrapper.tsx` (+18 -5) 📝 `apps/remix/app/components/general/envelope/envelope-upload-button.tsx` (+13 -0) 📝 `apps/remix/server/api/files/files.helpers.ts` (+30 -6) 📝 `apps/remix/server/api/files/files.ts` (+1 -1) ➕ `assets/test-document.docx` (+0 -0) ➕ `assets/test-image.jpg` (+0 -0) ➕ `assets/test-image.png` (+0 -0) 📝 `docker/development/compose.yml` (+9 -0) 📝 `packages/api/v1/implementation.ts` (+5 -3) 📝 `packages/app-tests/e2e/folders/team-account-folders.spec.ts` (+6 -3) 📝 `packages/lib/client-only/download-pdf.ts` (+36 -5) ➕ `packages/lib/constants/upload.ts` (+23 -0) 📝 `packages/lib/server-only/document-data/create-document-data.ts` (+10 -1) 📝 `packages/lib/server-only/document/get-document-by-access-token.ts` (+2 -0) 📝 `packages/lib/server-only/document/send-document.ts` (+7 -3) 📝 `packages/lib/server-only/envelope/duplicate-envelope.ts` (+1 -0) ➕ `packages/lib/server-only/file-conversion/convert-to-pdf.ts` (+50 -0) ➕ `packages/lib/server-only/gotenberg/gotenberg-client.ts` (+81 -0) 📝 `packages/lib/server-only/template/create-document-from-template.ts` (+5 -3) 📝 `packages/lib/types/document.ts` (+1 -0) _...and 18 more files_ </details> ### 📄 Description ### Description Enable uploads of DOCX/JPEG/PNG by converting to PDF via Gotenberg while preserving the original file for download, and update UI messaging/validation and download handling accordingly. ### Changes Made - Added upload constants/allowlist and Gotenberg config; added server-side conversion for non-PDF uploads in document/envelope creation with new conversion error handling. - Persisted original source files and MIME types on DocumentData with Prisma migrations; updated API queries/types to expose originalMimeType/originalData. - Updated file serving/downloading to return the original file when requested and to honor Content-Disposition filenames. - Updated upload UI/dropzones to accept PDF/DOCX/JPEG/PNG and refreshed error copy; added Gotenberg to dev compose and new test assets; adjusted an E2E upload step. ### Checklist - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ### Demo - Side by Side. Document in Microsoft Word and Signed in Documenso <img width="2048" height="1152" alt="Screenshot 2026-01-06 at 8 28 04 PM (2)" src="https://github.com/user-attachments/assets/b6ef87e8-7d68-4e2c-b0f6-9559a126ed52" /> ### Demo Files [Original Docx File](https://github.com/user-attachments/files/24459295/Documenso_Partnership_Agreement.docx) [Docx File Signed on Documenso](https://github.com/user-attachments/files/24459296/Documenso_Partnership_Agreement_signed.pdf) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2214
No description provided.