* Fix bug #34001: wrong stream length for compressed text

git-svn-id: trunk@39469 -
This commit is contained in:
michael 2018-07-18 12:10:23 +00:00
parent 2cf8a9661f
commit 3acdf481c2

View File

@ -4295,15 +4295,16 @@ begin
M := TMemoryStream.Create;
X.FStream.Write(M);
d := M.Size;
X.Dict.AddInteger('Length', M.Size);
if poCompressText in Options then
begin
MCompressed := TMemoryStream.Create;
CompressStream(M, MCompressed);
X.Dict.AddName('Filter', 'FlateDecode');
X.Dict.AddInteger('Length1', MCompressed.Size);
//X.Dict.AddInteger('Length1', MCompressed.Size); //Missing 'endstream' or incorrect stream length|stream Length incorrect
d := MCompressed.Size;
end;
X.Dict.AddInteger('Length', d);
X.Dict.Write(AStream);