From 8910c89caba3bce958160b87b3ba5f79a4a5e745 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Thu, 12 Feb 2026 15:56:55 +0700 Subject: [PATCH] fix: Reset PDF stream position to the beginning before reading to ensure correct processing. --- models/sign_document.py | 1 + 1 file changed, 1 insertion(+) diff --git a/models/sign_document.py b/models/sign_document.py index 70eea81..9abaf22 100644 --- a/models/sign_document.py +++ b/models/sign_document.py @@ -30,6 +30,7 @@ class SignDocument(models.Model): return base_output try: + base_output.seek(0) # IMPORTANT: Reset stream position to start base_pdf = PdfFileReader(base_output, strict=False) except (ValueError, PdfReadError): return base_output