fix: Reset PDF stream position to the beginning before reading to ensure correct processing.

This commit is contained in:
Suherdy Yacob 2026-02-12 15:56:55 +07:00
parent b234d8a7d0
commit 8910c89cab

View File

@ -30,6 +30,7 @@ class SignDocument(models.Model):
return base_output return base_output
try: try:
base_output.seek(0) # IMPORTANT: Reset stream position to start
base_pdf = PdfFileReader(base_output, strict=False) base_pdf = PdfFileReader(base_output, strict=False)
except (ValueError, PdfReadError): except (ValueError, PdfReadError):
return base_output return base_output