Using TRichView V13.5 with Delphi XE2, all service packs.
My program has the TRichView editor from one of your demo programs integrated and called by double-clicking on the field of a grid.
When, in the editor, I type a single line of text: "just a test", and save it, the generated RTF code is as follows:
{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fnil\fcharset0 tahoma;}{\f1\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard\lang0\f0\fs16 Just a test\par
\pard\lang3082\f1\par
}
This would appear to have some extra superfluous \par or \pard directives, if I am not mistaken ???
The problem becomes visible if you try to print this RTF using FastReport V4.11.17. The single-line band on the report, which is tall enough to show the text with no problems, actually stretches the band, adding white space below the text, because of the extra \par or \pard directive(s).
Is there a way to solve this problem ?
With a multi-line text: Line A
Line B
Line C
the generated RTF text is:
{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fnil\fcharset0 tahoma;}{\f1\fnil\fcharset0 Tahoma;}}
\viewkind4\uc1\pard\lang0\f0\fs16 Line A\par
Line B\par
Line C\par
\pard\lang3082\f1\par
}
All suggestions welcome.
Thanks
Jim Fleming
Superfluous \par directives in RTF ????
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks, Sergey.
> If the ending \par is not included, MS Word ignores attributes of the last paragraph
So, if I could strip away the \par just before that last \pard all should work OK ??
The RichText is coming from a database field and so cannot be accessed by Word. The only external representation will ever be a pdf file of the report produced by FastReport, never the RTF code itself directly.
JF
> If the ending \par is not included, MS Word ignores attributes of the last paragraph
So, if I could strip away the \par just before that last \pard all should work OK ??
The RichText is coming from a database field and so cannot be accessed by Word. The only external representation will ever be a pdf file of the report produced by FastReport, never the RTF code itself directly.
JF
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: