From: Hendrik Flamme <44997732+hflamme@users.noreply.github.com> Date: Fri, 16 May 2025 14:27:06 +0000 (+0200) Subject: fix size=0 Bytes bug (#71) X-Git-Tag: 2025.2.0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc9396a956e3316c19847336fa14831af89fcd6c;p=thirdparty%2Fpython-drafthorse.git fix size=0 Bytes bug (#71) --- diff --git a/drafthorse/pdf.py b/drafthorse/pdf.py index 459dcef..421b9cf 100644 --- a/drafthorse/pdf.py +++ b/drafthorse/pdf.py @@ -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()