Ich hatte das mal mit
Indy gemacht für PDF - Dateien:
Delphi-Quellcode:
...
procedure Base64DecodeToStream(const AText: string; AStream: TMemoryStream);
...
procedure Base64DecodeToStream(const AText: string; AStream: TMemoryStream);
var
DecodedStream: TBytesStream;
Decoder: TIdDecoderMIME;
begin
Decoder := TIdDecoderMIME.Create(nil);
try
DecodedStream := TBytesStream.Create;
try
Decoder.DecodeBegin(DecodedStream);
Decoder.Decode(AText);
Decoder.DecodeEnd;
DecodedStream.SaveToStream(AStream);
finally
DecodedStream.Free;
end;
finally
Decoder.Free;
end;
end;
Frank