]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
fix size=0 Bytes bug (#71)
authorHendrik Flamme <44997732+hflamme@users.noreply.github.com>
Fri, 16 May 2025 14:27:06 +0000 (16:27 +0200)
committerGitHub <noreply@github.com>
Fri, 16 May 2025 14:27:06 +0000 (16:27 +0200)
drafthorse/pdf.py

index 459dcef881a01a6b9a7f3229fc6473bda7b566c0..421b9cf9c6aa8ec0ce26a2eddd3a2e2a33cbd89f 100644 (file)
@@ -34,6 +34,7 @@ from pypdf.generic import (
     DecodedStreamObject,
     DictionaryObject,
     NameObject,
+    NumberObject,
     create_string_object,
 )
 
@@ -196,7 +197,7 @@ def _update_metadata_add_attachment(
             # NameObject('/CheckSum'): md5sum_obj,
             NameObject("/ModDate"): create_string_object(pdf_date),
             NameObject("/CreationDate"): create_string_object(pdf_date),
-            NameObject("/Size"): create_string_object(str(len(facturx_xml_str))),
+            NameObject("/Size"): NumberObject(len(facturx_xml_str)),
         }
     )
     file_entry = DecodedStreamObject()