RTF Question
Posted: Mon Nov 06, 2006 1:07 pm
Hi,
I am using the RichViewEdit Component and I need to be able to Encrypt Rich Text Format so that it keeps the formatting after it has been Decrypted.
I was at first just using the normal TRichEdit, but this is way to limited for what I need to do.
TRichViewEdit is amazing but I am having real frustrating problems trying to get my head around this!
I think to be able to encrypt the text and keep rtf formatting I first should encode it in Base64, I have DIMime units. I have been trying to encode it like this:
-----------------------------------
-----------------------------------
Example: the word 'test' is output like this:
Is this the right way to be doing this?
Could somebody give me some hints on how I can achieve what I am trying to do?
Any hints or a pointer would be very well appreciated, I can encrypt the text no problem it's just knowing how to do it so it keeps the rtf formatting.
Many thanks
Chris
I am using the RichViewEdit Component and I need to be able to Encrypt Rich Text Format so that it keeps the formatting after it has been Decrypted.
I was at first just using the normal TRichEdit, but this is way to limited for what I need to do.
TRichViewEdit is amazing but I am having real frustrating problems trying to get my head around this!
I think to be able to encrypt the text and keep rtf formatting I first should encode it in Base64, I have DIMime units. I have been trying to encode it like this:
-----------------------------------
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
MSource,MDest: TMemoryStream;
begin
MSource := TMemoryStream.Create;
MDest := TMemoryStream.Create;
MSource.Position := 0;
MDest.Position := 0;
rve.SaveRTFToStream(MSource,False);
MDest.Position := 0;
MSource.Position := 0;
MimeEncodeStream(MSource,MDest);
MSource.Position := 0;
MDest.Position := 0;
rve.Clear;
rve.LoadRTFFromStream(MDest);
rve.Format;
MSource.Free;
MDest.Free;
end;
Example: the word 'test' is output like this:
Is this the right way to be doing this?
Could somebody give me some hints on how I can achieve what I am trying to do?
Any hints or a pointer would be very well appreciated, I can encrypt the text no problem it's just knowing how to do it so it keeps the rtf formatting.
Many thanks
Chris