Page 1 of 1

Why metods LoadRTFFromStream and SaveRTFToStream no Pictures

Posted: Tue Sep 11, 2018 9:56 am
by sage12
Hi.
Why save / loading of the data in / from database together with pictures through RTF does not work?
Through RVF save / loading works.

Code: Select all

procedure TRichEditFrame.LoadFromStream(Stream: TStream);
begin
  // Filling font names combobox
  cmbFont.Properties.Items.Assign(Screen.Fonts);
  Visible := False;
  RichEdit.Clear;
  if Stream.Size <> 0 then
  begin
    Stream.Seek(0, soFromBeginning);
//    RichEdit.LoadRVFFromStream(Stream); //lion
    RichEdit.LoadRTFFromStream(Stream);  // Alex
  end;
  RichEdit.Format;
  // you can delete non default styles here...
  RichEditCurTextStyleChanged(nil);
  RichEditCurParaStyleChanged(nil);
  SetParantFont;
  Visible := True;
  RichEdit.Modified := False;
end;

procedure TRichEditFrame.SaveToStream(Stream: TStream);
begin
  Stream.Size := 0;
//  RichEdit.SaveRVFToStream(Stream, False); //lion
  RichEdit.SaveRTFToStream(Stream, False); // Alex
  RichEdit.Modified := False;
end;
Thanks.

Re: Why metods LoadRTFFromStream and SaveRTFToStream no Pictures

Posted: Tue Sep 11, 2018 11:10 am
by Sergey Tkachenko
Please send me RTF file which is loaded without pictures (send to richviewgmailcom) or attach to this forum.

PS: if you use Lazarus, TRichView cannot load metafiles from RTF, because Lazarus does not have TMetafile class.