Import from Word (some problems)

General TRichView support forum. Please post your questions here
Post Reply
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Import from Word (some problems)

Post by BernhardRoos »

I'm testing TRichView. We are planning to buy it in the near future.
It is a very good Component (so far my first impressions).

But there are some problems if I'm importing a Word Document (Word 2003). The tables are more width as the tables in the Word Document. In Word I can see the whole table (width). In the preview of TRichView on the right side the table was cut (I'm missing 20-40%)

Is there a way to solve this problem?

Best wishes
Bernhard
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you import it via office converter? In this case, the results may be worse, because converters sometimes generate bad intermediate RTF.
Try to save document as RTF in Word and open in in TRichViewEdit (or copy-paste it, results should be the same).
If the problem still exists, send me this document to [email protected]
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Post by BernhardRoos »

I've tried both (Insert File) and Open as Richtext (after I've saved in Word as Richtext) and Copy/Paste. But the result is always worse. But I have to say that the Word Document is not trivial (it is a manual). Can I send it to you per E-Mail?
Best wishes
Bernhard
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, send it to me.

I can see the following possible reasons for this problem

1) CellPadding. MS Word allows different cell paddings for each cell, and different values for each cell side. By default, it uses the same values for all table cells, but different horizontal and vertical cell padding. TRichView v1.9.24 supports only one CellPadding. The latest version supports vertical and horizontal CellPaddings, so a typical MS Word table must be loaded better.
2) These tables use width modes unsupported by TRichView (for example, fit-to-content)
3) TRichView tables use HTML-like model, so a conversion is performed when loading RTF. Sometimes this conversion is very complicated, and it's not always possible to retain all original table attributes.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I received your file.
It's a bug in TRichView. In your file, widths of all tables (except for the first one) are specified in absolute values (twips), but because of this bug they are treated as %. So tables have about 180% of the editor width.
It will be fixed in the next update.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you are also interested why in MS Word (in TOC), there is only horizontal lines above some paragraphs, but TRichView displays also left and right sides of paragraphs borders.

It's because these paragraphs have top, left and right borders, but left and right border sides are white (you can see it if you change document background color in MS Word). TRichView does not support different colors for paragraph border sides, so it uses color of the top border side.
If you need to hide some paragraph borders in TRichView, just hide them (like it was done for the bottom side of these paragraphs) instead of making them white.
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Post by BernhardRoos »

Thanks for your answer. Your support is very good.
Post Reply