[GH-ISSUE #1912] Visual signatures not rendered on completed PDFs despite successful background job completion #550

Closed
opened 2026-02-26 18:47:33 +03:00 by kerem · 6 comments
Owner

Originally created by @cch1985 on GitHub (Jul 19, 2025).
Original GitHub issue: https://github.com/documenso/documenso/issues/1912

Issue Description

[BUG] Visual signatures not rendered on completed PDFs despite successful background job completion

Summary

Documenso v1.12.0 captures signature data correctly and reports successful completion, but downloaded PDFs show no visual signatures. The decorate-and-sign-pdf background job completes with status COMPLETED, yet signature overlays are not applied to the final document.

Environment

  • Documenso Version: v1.12.0
  • Deployment: Docker Compose
  • Database: PostgreSQL 15
  • Storage: MinIO S3-compatible
  • Container Runtime: Docker

Evidence

Database Verification

-- Signature data is captured correctly
SELECT "recipientId", "fieldId", "typedSignature" FROM "Signature" WHERE "recipientId" = 19;
-- Result: recipientId=19, fieldId=35, typedSignature="TESTY"

-- Background jobs complete successfully  
SELECT status, "createdAt", "completedAt" FROM "BackgroundJobTask" 
WHERE name = 'decorate-and-sign-pdf' ORDER BY "createdAt" DESC LIMIT 3;
-- Result: All show status=COMPLETED with proper timestamps

-- Document processing creates signed version
SELECT data, "initialData" FROM "DocumentData" WHERE id = 'cmdalhpqs0000sa1mzkexf53m';
-- Result: Different file paths for signed vs original (signed version is larger)

Technical Verification

  • Certificate: Valid PKCS12 file (2714 bytes) accessible at /app/example/cert.p12
  • PDF Libraries: pdf-lib v1.17.1 and @documenso/pdf-sign@0.1.0 present
  • Job Execution: Background jobs reach correct endpoints and complete
  • File Storage: "Signed" PDFs exist in MinIO storage with larger file sizes

Logs

No errors in logs - background jobs complete silently:

[JOBS]: Triggering job decorate-and-sign-pdf with payload { documentId: 19 }
Submitting job to endpoint: http://documenso:3000/api/jobs/...

Job completes but produces no visual output on PDF.

Impact

  • Production Issue: Clients receive legally signed documents that appear unsigned
  • Compliance Risk: Documents lack visual evidence of electronic signatures
  • User Experience: Confusing for signers who expect to see their signatures

Workaround

Currently implementing PDF signature overlay in webhook handler using captured signature data, but this shouldn't be necessary.

Additional Context

  • Signature field coordinates are correct (validated placement)
  • Certificate is valid and accessible
  • All dependent services (database, storage) working
  • Issue appears specific to PDF overlay rendering process

Expected Fix

The decorate-and-sign-pdf background job should successfully overlay visual signatures onto the PDF using the captured signature data and field coordinates.

Steps to Reproduce

  1. Create document with signature fields
  2. Send for signing via API or UI
  3. Complete signing process (typed signature)
  4. Wait for background job completion
  5. Download completed document
  6. Observe: No visual signatures despite "COMPLETED" status

Expected Behavior

Completed documents should display visual signatures (typed signatures, drawn signatures, dates) overlaid on the PDF at the specified field coordinates.

Current Behavior

  • Signature data is captured and stored in database correctly
  • Background job decorate-and-sign-pdf completes successfully
  • Document status changes to COMPLETED
  • Downloaded PDFs contain no visual signatures

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]

1.12.0

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 @cch1985 on GitHub (Jul 19, 2025). Original GitHub issue: https://github.com/documenso/documenso/issues/1912 ### Issue Description # [BUG] Visual signatures not rendered on completed PDFs despite successful background job completion ## Summary Documenso v1.12.0 captures signature data correctly and reports successful completion, but downloaded PDFs show no visual signatures. The `decorate-and-sign-pdf` background job completes with status `COMPLETED`, yet signature overlays are not applied to the final document. ## Environment - **Documenso Version:** v1.12.0 - **Deployment:** Docker Compose - **Database:** PostgreSQL 15 - **Storage:** MinIO S3-compatible - **Container Runtime:** Docker ## Evidence ### Database Verification ```sql -- Signature data is captured correctly SELECT "recipientId", "fieldId", "typedSignature" FROM "Signature" WHERE "recipientId" = 19; -- Result: recipientId=19, fieldId=35, typedSignature="TESTY" -- Background jobs complete successfully SELECT status, "createdAt", "completedAt" FROM "BackgroundJobTask" WHERE name = 'decorate-and-sign-pdf' ORDER BY "createdAt" DESC LIMIT 3; -- Result: All show status=COMPLETED with proper timestamps -- Document processing creates signed version SELECT data, "initialData" FROM "DocumentData" WHERE id = 'cmdalhpqs0000sa1mzkexf53m'; -- Result: Different file paths for signed vs original (signed version is larger) ``` ### Technical Verification - **Certificate:** Valid PKCS12 file (2714 bytes) accessible at `/app/example/cert.p12` - **PDF Libraries:** pdf-lib v1.17.1 and @documenso/pdf-sign@0.1.0 present - **Job Execution:** Background jobs reach correct endpoints and complete - **File Storage:** "Signed" PDFs exist in MinIO storage with larger file sizes ## Logs No errors in logs - background jobs complete silently: ``` [JOBS]: Triggering job decorate-and-sign-pdf with payload { documentId: 19 } Submitting job to endpoint: http://documenso:3000/api/jobs/... ``` Job completes but produces no visual output on PDF. ## Impact - **Production Issue:** Clients receive legally signed documents that appear unsigned - **Compliance Risk:** Documents lack visual evidence of electronic signatures - **User Experience:** Confusing for signers who expect to see their signatures ## Workaround Currently implementing PDF signature overlay in webhook handler using captured signature data, but this shouldn't be necessary. ## Additional Context - Signature field coordinates are correct (validated placement) - Certificate is valid and accessible - All dependent services (database, storage) working - Issue appears specific to PDF overlay rendering process ## Expected Fix The `decorate-and-sign-pdf` background job should successfully overlay visual signatures onto the PDF using the captured signature data and field coordinates. ### Steps to Reproduce 1. Create document with signature fields 2. Send for signing via API or UI 3. Complete signing process (typed signature) 4. Wait for background job completion 5. Download completed document 6. Observe: No visual signatures despite "COMPLETED" status ### Expected Behavior Completed documents should display visual signatures (typed signatures, drawn signatures, dates) overlaid on the PDF at the specified field coordinates. ### Current Behavior - Signature data is captured and stored in database correctly - Background job `decorate-and-sign-pdf` completes successfully - Document status changes to `COMPLETED` - Downloaded PDFs contain no visual signatures ### 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] 1.12.0 ### 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. - [ ] 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
kerem 2026-02-26 18:47:33 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 19, 2025):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:3092530370 --> @github-actions[bot] commented on GitHub (Jul 19, 2025): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@cch1985 commented on GitHub (Jul 19, 2025):

Did some deeper investigation and seemed to find the exact issue? The signature fields are being created and populated, but they have broken coordinates.
When examining the signed PDF structure, I found:
/T (Signature1)
/FT /Sig
/V 63 0 R
/Rect [ 0 0 0 0 ] ← This should be actual coordinates like [54 708 324 744]
So the signature exists and has a value, but it's rendered in a zero-width, zero-height rectangle at position 0,0 - making it invisible.
This explains why:

Background jobs complete successfully
Signed PDFs are much larger than originals (1.8MB vs 570KB)
Database shows captured signature data
But no visual signatures appear

The field coordinates aren't being properly transferred from the field definition to the final PDF form field in v1.12.0.
This looks to be a Documenso bug rather than an environment/configuration issue. Has anyone else seen similar rectangle coordinate problems?

<!-- gh-comment-id:3092540393 --> @cch1985 commented on GitHub (Jul 19, 2025): Did some deeper investigation and seemed to find the exact issue? The signature fields are being created and populated, but they have broken coordinates. When examining the signed PDF structure, I found: /T (Signature1) /FT /Sig /V 63 0 R /Rect [ 0 0 0 0 ] ← This should be actual coordinates like [54 708 324 744] So the signature exists and has a value, but it's rendered in a zero-width, zero-height rectangle at position 0,0 - making it invisible. This explains why: Background jobs complete successfully Signed PDFs are much larger than originals (1.8MB vs 570KB) Database shows captured signature data But no visual signatures appear The field coordinates aren't being properly transferred from the field definition to the final PDF form field in v1.12.0. This looks to be a Documenso bug rather than an environment/configuration issue. Has anyone else seen similar rectangle coordinate problems?
Author
Owner

@cch1985 commented on GitHub (Jul 19, 2025):

When I manually upload a document and send out for signature, the resulting "completed" document has the proper signatures embeded. So this seems to be an issue with API positioning of signature boxes/dates.

<!-- gh-comment-id:3092554078 --> @cch1985 commented on GitHub (Jul 19, 2025): When I manually upload a document and send out for signature, the resulting "completed" document has the proper signatures embeded. So this seems to be an issue with API positioning of signature boxes/dates.
Author
Owner

@cch1985 commented on GitHub (Jul 20, 2025):

After investigating the PDF structure, I identified that form fields were being created with malformed rectangles displaying /Rect [ 0 0 0 0 ] coordinates. This resulted in signature fields with zero dimensions, rendering them invisible despite containing valid data.
Technical Issues Identified:
The problem stemmed from two implementation errors in the Documenso API integration:

Coordinate System Mismatch: I was sending absolute pixel coordinates (values like 152.5, 156.5) when Documenso requires percentage-based coordinates within the 0-100 range. Values outside this range cause field rectangle corruption.
Incorrect Page Indexing: I was applying a -1 conversion assuming 0-based page indexing, when Documenso actually uses 1-based page numbering.

Resolution Process:

Corrected the page numbering logic by removing the erroneous -1 conversion in addSignatureFields()
Conducted manual field placement in the Documenso UI to obtain reference coordinates
Extracted working percentage-based coordinates via database queries
Updated all SIGNATURE_COORDINATES configurations with proper percentage values (0-100 range)

<!-- gh-comment-id:3094760959 --> @cch1985 commented on GitHub (Jul 20, 2025): After investigating the PDF structure, I identified that form fields were being created with malformed rectangles displaying /Rect [ 0 0 0 0 ] coordinates. This resulted in signature fields with zero dimensions, rendering them invisible despite containing valid data. Technical Issues Identified: The problem stemmed from two implementation errors in the Documenso API integration: Coordinate System Mismatch: I was sending absolute pixel coordinates (values like 152.5, 156.5) when Documenso requires percentage-based coordinates within the 0-100 range. Values outside this range cause field rectangle corruption. Incorrect Page Indexing: I was applying a -1 conversion assuming 0-based page indexing, when Documenso actually uses 1-based page numbering. Resolution Process: Corrected the page numbering logic by removing the erroneous -1 conversion in addSignatureFields() Conducted manual field placement in the Documenso UI to obtain reference coordinates Extracted working percentage-based coordinates via database queries Updated all SIGNATURE_COORDINATES configurations with proper percentage values (0-100 range)
Author
Owner

@samwathegreat commented on GitHub (Jul 29, 2025):

@cch1985 Hi, this shows closed, but I'm still experiencing this issue. It looks like you resolved it, but how do we fix it on our end? Must we wait for the next release? Thanks in advance.

EDIT: Running latest version 1.12.1

<!-- gh-comment-id:3133903934 --> @samwathegreat commented on GitHub (Jul 29, 2025): @cch1985 Hi, this shows closed, but I'm still experiencing this issue. It looks like you resolved it, but how do we fix it on our end? Must we wait for the next release? Thanks in advance. EDIT: Running latest version 1.12.1
Author
Owner

@samwathegreat commented on GitHub (Aug 4, 2025):

@cch1985 This error persists and is easily reproducible. It's happening regardless of signature type per my testing this morning. Not a single "completed" document actually has the visual signature embedded in the final pdf.

Can we please re-open this issue?

@catalinpit

<!-- gh-comment-id:3151093280 --> @samwathegreat commented on GitHub (Aug 4, 2025): @cch1985 This error persists and is easily reproducible. It's happening regardless of signature type per my testing this morning. Not a single "completed" document actually has the visual signature embedded in the final pdf. Can we please re-open this issue? @catalinpit
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#550
No description provided.