Page 1 of 1

Background colour (with \highlight) not importing from RTF?

Posted: Tue Mar 10, 2009 12:15 pm
by martindholmes
Hi there,

I've been sent an RTF file produced by Word, which shows yellow highllighting on some strings of text. This shows up OK in WordPad, but fails to import into TRichView (I've tried with my app, and with the ActionTest demo). The highlighting is lost.

In this discussion:

http://www.trichview.com/forums/viewtopic.php?t=1800

you mentioned that "Wordpad does not understand text background, it understands text highlighting. Word understands the both of them. TRichView imports highlighting as text background, but saves only text background. "

so I think the \highlight tag should import correctly into TRichView. This is a sample of the RTF code which is causing the problem:
\par }{\cs16\fs20\cf1\lang2057\langfe2052\loch\af391\hich\af391\dbch\af35\chshdng0\chcfpat0\chcbpat8\langnp2057\insrsid15162747\charrsid15162747 \hich\af391\dbch\af35\loch\f391 As a child, I used to love reading. Roald Dahl\hich\f391 \rquote \loch\f391
s stories used to be my favourite ones. However, I was educated to love sciences }{\cs16\fs20\cf1\lang2057\langfe2052\loch\af35\hich\af35\dbch\af35\chshdng0\chcfpat0\chcbpat8\langnp2057\insrsid15162747\charrsid15162747 \hich\af35\dbch\af35\loch\f35
instead}{\cs16\fs20\cf1\lang2057\langfe2052\loch\af35\hich\af35\dbch\af35\chshdng0\chcfpat0\chcbpat8\langnp2057\insrsid3624578 \hich\af35\dbch\af35\loch\f35 and, when I was in my teens, I }{
\cs16\fs20\cf1\lang2057\langfe2052\highlight7\loch\af35\hich\af35\dbch\af35\chshdng0\chcfpat0\chcbpat8\langnp2057\insrsid3624578\charrsid12397010 \hich\af35\dbch\af35\loch\f35 stopped}{
\cs16\fs20\cf1\lang2057\langfe2052\loch\af35\hich\af35\dbch\af35\chshdng0\chcfpat0\chcbpat8\langnp2057\insrsid3624578 \hich\af35\dbch\af35\loch\f35 }{

Can you see what might be causing the problem?

Cheers,
Martin

Posted: Tue Mar 10, 2009 12:30 pm
by Sergey Tkachenko
Please send me the complete RTF file to test.

Posted: Tue Mar 10, 2009 2:17 pm
by Sergey Tkachenko
I received this RTF.
The problem is the following. Just after the highlight keyword (\highlight), the text background (shading) keyword follows (\chcbpat). It instructs to make text background white.
Ok, I make changes to ignore shading for highlighted text. They will be uploaded with the next update.

Posted: Wed Mar 11, 2009 11:32 am
by martindholmes
Thanks Sergey!