RTF Import Justifications Not Respected

4 posts, 0 answers
  1. ben
    ben avatar
    5 posts
    Member since:
    Jul 2007

    Posted 02 Nov 2012 Link to this post

    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.


  2. Svett
    Svett avatar
    728 posts

    Posted 05 Nov 2012 Link to this post

    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.

    the Telerik team
    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. Walter
    Walter avatar
    3 posts
    Member since:
    Feb 2014

    Posted 07 Aug 2014 in reply to Svett Link to this post

    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.
  4. Dimitar
    Dimitar avatar
    2162 posts

    Posted 12 Aug 2014 Link to this post

    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.
    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.
Back to Top