[GH-ISSUE #1490] Signing Documents produces really large PDF files #421

Open
opened 2026-02-26 18:46:59 +03:00 by kerem · 5 comments
Owner

Originally created by @ArbiterGR on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1490

Issue Description

When signing documents, the signed version of the document, documenso produces is really large. Around ~3-5mb for a single page, or ~16mb for a 2 pages document.

Steps to Reproduce

Complete a signing flow and observe the result file's size

Expected Behavior

The files should be as close to the original size as possible.

Current Behavior

The files produced are really large, making their storage long term an issue.

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

No response

Browser [e.g., Chrome, Firefox]

No response

Version [e.g., 2.0.1]

No response

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @ArbiterGR on GitHub (Nov 22, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1490 ### Issue Description When signing documents, the signed version of the document, documenso produces is really large. Around ~3-5mb for a single page, or ~16mb for a 2 pages document. ### Steps to Reproduce Complete a signing flow and observe the result file's size ### Expected Behavior The files should be as close to the original size as possible. ### Current Behavior The files produced are really large, making their storage long term an issue. ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] _No response_ ### Browser [e.g., Chrome, Firefox] _No response_ ### Version [e.g., 2.0.1] _No response_ ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [X] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
Author
Owner

@Mythie commented on GitHub (Nov 22, 2024):

Can you provide an example PDF where this happens? I ran a few tests locally but nothing came up significantly larger on my end, there was some file size growth but that's to be expected since the certificate is attached.

<!-- gh-comment-id:2495027255 --> @Mythie commented on GitHub (Nov 22, 2024): Can you provide an example PDF where this happens? I ran a few tests locally but nothing came up significantly larger on my end, there was some file size growth but that's to be expected since the certificate is attached.
Author
Owner

@ArbiterGR commented on GitHub (Nov 23, 2024):

Can you provide an example PDF where this happens? I ran a few tests locally but nothing came up significantly larger on my end, there was some file size growth but that's to be expected since the certificate is attached.

Thank you for the reply. For starters, this is on a self-hosted docker based instance. I did some tests since i opened this issue. If i only sign the document, meaning no other fields set and populated, the file size grows just a little bit to include the signature image and certificate as expected.

However if i use a template for the same document which has text fields and drop down menus as well, the resulting signed pdf is huge.

Here's some test pdfs i produced for testing:

Unsigned pdf: test_pdf_unsigned.pdf / file size 414.8kb

Signature Only pdf: test_pdf_signature_only.pdf / File Size 756.4kb

Signature & fields pdf: test_pdf_signature_and_fields.pdf / File Size 5.1mb

test_pdf_signature_and_fields.pdf
test_pdf_signature_only.pdf
test_pdf_unsigned.pdf

Edit: Re-attached test PDFs

<!-- gh-comment-id:2495429079 --> @ArbiterGR commented on GitHub (Nov 23, 2024): > Can you provide an example PDF where this happens? I ran a few tests locally but nothing came up significantly larger on my end, there was some file size growth but that's to be expected since the certificate is attached. Thank you for the reply. For starters, this is on a self-hosted docker based instance. I did some tests since i opened this issue. If i only sign the document, meaning no other fields set and populated, the file size grows just a little bit to include the signature image and certificate as expected. However if i use a template for the same document which has text fields and drop down menus as well, the resulting signed pdf is huge. Here's some test pdfs i produced for testing: Unsigned pdf: test_pdf_unsigned.pdf / file size 414.8kb Signature Only pdf: test_pdf_signature_only.pdf / File Size 756.4kb Signature & fields pdf: test_pdf_signature_and_fields.pdf / File Size 5.1mb [test_pdf_signature_and_fields.pdf](https://github.com/user-attachments/files/17879363/test_pdf_signature_and_fields.pdf) [test_pdf_signature_only.pdf](https://github.com/user-attachments/files/17879364/test_pdf_signature_only.pdf) [test_pdf_unsigned.pdf](https://github.com/user-attachments/files/17879365/test_pdf_unsigned.pdf) **Edit**: Re-attached test PDFs
Author
Owner

@Dav-id commented on GitHub (Mar 24, 2025):

We are experiencing this where our documents grow to 50mb each after adding fields and signing

<!-- gh-comment-id:2747604844 --> @Dav-id commented on GitHub (Mar 24, 2025): We are experiencing this where our documents grow to 50mb each after adding fields and signing
Author
Owner

@cfredericksen commented on GitHub (Jun 19, 2025):

I am experiencing large PDFs as well. My database is 600MB with 30 completed documents.

<!-- gh-comment-id:2986529757 --> @cfredericksen commented on GitHub (Jun 19, 2025): I am experiencing large PDFs as well. My database is 600MB with 30 completed documents.
Author
Owner

@Dav-id commented on GitHub (Jun 23, 2025):

This is still happening.

The issue is very simple to replicate - for each field (we are adding via API) the document grows at an unexpectedly large rate.

<!-- gh-comment-id:2994983105 --> @Dav-id commented on GitHub (Jun 23, 2025): This is still happening. The issue is very simple to replicate - for each field (we are adding via API) the document grows at an unexpectedly large rate.
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#421
No description provided.