Page 1 of 1

Loading RTF with MS Equation objects

Posted: Wed Nov 26, 2008 12:35 pm
by kuaw26
Hello! I've just download trial version of RichView for Delphi 2007.

I need to out some text with lots of math formulas written in MS Word + MS Equation and than saved to RTF format and loaded to RichView.

The file was succesfuly loaded, but it look not very good especially for large formulas. TRichView align them to bottom instead of center (as MS Word do).

It is possible to tweak any option of TRichView to make text looks like it looks in MS Word?

P.S. By the way MS WordPad is also draw rtf with MS Equation objects alignin them to bottom of line.

P.S.S. I find one solution, but it not good, because it realy need a lot of hand work. So, the solution: in MS word write all text in table and place every MS Equation in its own cell. Then set for all cells vertical align - center, set Table options - invisible table lines. Save as RTF. Load in TRichView - it looks almost nice. So as I see TRichView has an ability to do what I need... any help?

Posted: Wed Nov 26, 2008 4:52 pm
by Sergey Tkachenko
Unfortunately, it is not possible to implement it automatically.

MS Word processes equations specially: it aligns the base line of text in equations to the base line of normal text.
In TRichView, objects are not loaded from RTF, so equations are loaded as pictures (metafiles). It applies a default alignment to pictures loaded from RTF (rvvaBaseLine - bottom of picture is aligned to the base line of text).

In TRichView, you can move pictures down by changing the extra item property rvepVShift and rvepVShiftAbs (see the help on TRVExtraItemProperty) or by changing VAlign (using SetPictureInfo or similar editing methods).

Posted: Wed Nov 26, 2008 6:06 pm
by kuaw26
Sergey Tkachenko wrote:Unfortunately, it is not possible to implement it automatically.
...skiped...
well. thanks. it is a pity that there no easy solution, but I'll try to shift down images manualy after RTFLoad.