diff --git a/pypdf/generic/_base.py b/pypdf/generic/_base.py index d973515a5..dae799e0e 100644 --- a/pypdf/generic/_base.py +++ b/pypdf/generic/_base.py @@ -417,7 +417,7 @@ def writeToStream( @staticmethod def read_from_stream(stream: StreamType) -> Union["NumberObject", "FloatObject"]: - num = read_until_regex(stream, NumberObject.NumberPattern) + num = read_until_regex(stream, NumberObject.NumberPattern, ignore_eof=True) if num.find(b".") != -1: return FloatObject(num) return NumberObject(num)