Page 1 of 1

TCustomRichView.LoadRTFFromStream Slowness

Posted: Tue Jul 15, 2008 2:09 am
by hxr
Hello All

I'm using TRichView v 1.9.24 with Turbo Delphi 2006 to display rtf document via LoadRTFFromStream. For a particular document, it is 2M is size and 1.8M of which seems to be header information for fonts, lists, etc. When trying to load this document, it took 5-6 minutes in TRVRTFReader.Parse. I loaded the same document in another non Delphi rtf viewer, it took no time to display it.

Any ideas/suggestions for this?
Thanks

Posted: Tue Jul 15, 2008 8:20 pm
by Sergey Tkachenko
That another rtf viewer may just ignore all this header info, and it displays a text alternative to list markers (even the standard RichEdit does not support MS Word's way of saving bullets&numbering and loads them as a plain text followed by tab).
If this RTF file was created by TRichView, call DeleteUnusedStyles(True,True, True) after loading and resave.

Posted: Tue Jul 15, 2008 11:16 pm
by hxr
Hi Sergey

I've tried your suggestion. It removed lots of header information from the file and reduced its size from 2M to 150K. The resulting file seems to be the same as it was as RTF and the loading speed problem is solved.

Thanks a lot.