RTF table problem

General TRichView support forum. Please post your questions here
Post Reply
Mahris
Posts: 2
Joined: Wed Jul 01, 2009 1:21 pm

RTF table problem

Post by Mahris »

Hi,

I posted my customer's RTF in http://www.sendspace.com/file/atfr9x

When I load it with
RichViewEdit.LoadRTF('test_31c.rtf');
RichViewEdit.Format;
column sizes are damaged.
First line in Word's first column contains "Small, build your own".
First line in RichViewEdit first column contains only "Small, buid".

Is there any workaround to get a normal view for this RTF?

Thank you,
Mahris

P.S. An interesting additional feature. Let us consider the following steps.
I open the rtf in Word and save as doc.
Now, in program I do the following:
RVOfficeConverter.ImportRTF('test_31c.doc',3);
RVOfficeConverter.Stream.Position:=0;
RichViewEdit.LoadRTFFromStream(RVOfficeConverter.Stream);
RichViewEdit.Format;

And everything is OK in RichViewEdit.

(Of course, converter 3 is specific to my environment. It is Word 97-2002).
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid this problem cannot be solved in the current TRichView version. The only solution is simplifying the table. TRichView uses HTML table model, so tables imported from RTF may sometimes look different.
Currently, the only possible solution is simplifying this table. Making columns in heading (description | q | q) match the table content should help.
Probably in future table layout algorithm will be improved for such tables, but not in very near future.
Mahris
Posts: 2
Joined: Wed Jul 01, 2009 1:21 pm

Post by Mahris »

Thank you, Sergey.

Obviously, I should look for another solution.
I got a program to make improvements.
The task is - extract some rtf text parts interpreted as leading info and print the rest using extracted info.

The previous author loaded rtf in TRichViewEdit, processed text changes and printed using TRVPrint.

I did required enhancements - and then test_31c arrived.

The only fully functional solution I currently see - remove all TRichView stuff and do the task invoking directly MS Word through ActiveX.

Thank you,
Mahris
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid if you need complex documents look exactly like in MS Word, the only way is using MS Word.
Post Reply