Thema: Broken TBytes

Einzelnen Beitrag anzeigen

wil32

Registriert seit: 27. Okt 2015
3 Beiträge
 
#1

Broken TBytes

  Alt 27. Okt 2015, 20:42
Delphi-Version: XE8
Delphi-Quellcode:
procedure WhyIsItNotWorking;
var
Stream : TBytesStream;
b : TBytes ;
begin
Stream := TBytesStream.Create;
Stream.LoadFromFile( AttachedPDF );

b := Stream.Bytes ;

Stream := TBytesStream.Create( b );
Stream.SaveToFile( AttachedPDF + '2' );

FreeAndNil(Stream);
end;
2nd file is corrupted. there is a bunch of wrong bytes at the end of the file. if you notepad the 2nd pdf and remove said bytes. everything is normal

http://rghost.net/private/67PGPC8QF/...ccaf86fec0bb41

this is a form/fillable pdf

above code works with 'regular' pdf

Geändert von MrSpock (28. Okt 2015 um 08:23 Uhr) Grund: Delphi Tags eingefügt.
  Mit Zitat antworten Zitat