Differences in rtf text

Stimulsoft Reports.NET discussion
Post Reply
grazi
Posts: 39
Joined: Fri May 23, 2008 1:55 am

Differences in rtf text

Post by grazi »

Hi there

We have a strange problem. Text in a rtf box isn't the same size (and maybe not the same font) as when we use static text embedded in the report. The rtf source is 100% correct. If we copy and paste the rtf source to a empty text file, rename it to rtf and open it in word, everything is perfect, size and font are correct.

But when we use the same rtf source in a report, there are some minor differences (see image). Text 1 is static text embedded in the report. Text 2 is a rtf text box. Why do they have different lenghts? The differences aren't big but our customer wants a perfect report so we have to fix it.

Image

Does anyone have an idea?!

Thanks, Grazi
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Differences in rtf text

Post by Ivan »

Hello,

RichTextBox uses riched20.dll for text rendering. This dll is drawing the text with the help of its internal methods, not as GDI and GDI +, and not as the MS-Word. Also in Windows can be installed different versions of riched20.dll (from 3.0 in WinXP to 6.0 in Office2007). Therefore, the text in the Textbox and RichTextBox can looks vary.

Solutions:
1. Try to set for textbox a different TextQuality. In some cases the text in the Textbox become similar to the RichTextBox. For different fonts try different TextQuality.
2. In the latest build Textbox has a property AllowHtmlTags, and now you can use the simple formatting of text directly into the TextBox.

Thank you.
grazi
Posts: 39
Joined: Fri May 23, 2008 1:55 am

Differences in rtf text

Post by grazi »

Hello

OK thank you for the infos about rtf. I will try to set the TextQuality.

Thanks
Post Reply