This is a migrated thread and some comments may be shown as answers.

RTF Import Justifications Not Respected

3 Answers 66 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
ben
Top achievements
Rank 1
ben asked on 02 Nov 2012, 07:10 PM
Steps to reproduce
  • In a sample application I have the Rich Text Box setup and input four lines of text into the document
  • The first line I'll left justify
  • The second I'll right justify
  • Third center justify
  • And the forth left justify
  • Save the document as an RTF document
  • Re-open the document and the forth line that was supposed to be left justified is now centered justified.

Microsoft Word and Word Pad both respect the last justification.

Thoughts?

-ben

3 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 05 Nov 2012, 04:37 PM
Hello Ben,

Thank you for your report.

I managed to reproduce the issue. I logged it in our public issue tracking system and it will be addressed in one of the next releases. I cannot give you work around due to internal implementation of RtfFormatProvider. I hope that this is not show stopper.

I updated your Telerik points.

Greetings,
Svett
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Walter
Top achievements
Rank 1
answered on 07 Aug 2014, 07:17 PM
Since this bug is going on 2 years or more old, it doesn't look like they're going to fix it.  I would think that justification working is a major component of a text editor, but whatever, I found a work around.  After the text was exported to RTF, I did a search and replace and replaced the \SMULTx tags with \SMULTx\ql\ .  It appears that once it gets a \qr or \qc tag, from then on it quites writing the \ql tags.  By inserting that, it makes every line default to left justified, and then if it's supposed to be right or center justified, that tag comes next which appears to be the one that is used.  

It worked for my scenario at least.
0
Dimitar
Telerik team
answered on 12 Aug 2014, 12:03 PM
Hi Walter,

Thank you for contacting us.

I can confirm that the issue is not fixed yet. Currently you can find the issue details in the following page: FIX. RadRichTextBox - Rtf importing does not obey text alignment of the last line. There you can follow this item and add your vote/comment for it.

I am glad that you have found a workaround for your case and I am sure that the community will benefit from it.

Do not hesitate to contact us if you have any questions.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
ben
Top achievements
Rank 1
Answers by
Svett
Telerik team
Walter
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or