Import Byte[] document from MVC editor to WPF RadRichTextBoxRichText

3 posts, 0 answers
  1. Cristiano
    Cristiano avatar
    13 posts
    Member since:
    Feb 2012

    Posted 15 Apr 2015 Link to this post


    I had some sort of problems trying to attach my tests so I upload them to wetransfer so you can download them.
    On the following link, you will find 2 projects: a WPF and MVC one.

    The point is to load and export documents between WPF RadRichTextBoxRichText and MVC Editor.
    This is what simulate our enterprise softwares.


    In the WPF test app, we have a file test.txt with a hexadecimal code of a document created in our WPF application's RadRichTextBoxRichText. 
    If you click on the button "Import" you can see the original formatations. Then, if you click the button "Export" you will convert that doc to hexadecimal and copy it to the clipboard so you can past on the MVC test app.


    In the MVC test app, you can past that hexadecimal code clicking on "Past Hex" button, and you will see that the document was imported well succeded with all formatations.

    I guess the main problem begin in the WEB app. 

    First problem:
    If I export the document to hexadecimal from the MVC editor, clicking on " Get Hex" button, and copy that again using the button "Past Hex", you will realise that you lost all the spaces between lines.

    Second problem:
    To replicate the following problem, please, follow these steps:
    1 - Click "Import From test.txt"
    2 - Edit the line where it begins with  "No estudo efectuado não..." , delete the rest of that line leaving just that words, and apply a background color to them.
    3 - Justify that words.
    4 - Click "Get Hex" and copy the hex code written on the footer.
    5 - Replace the hexadecimal code in test.txt in WPF application with the copied hexadecimal.
    6 - Run the WPF app and click "Import"

    Now, if you look, you can see that:
           The justified line is with extra spaces, 
           All the spaces between lines have been lost, 
           There is no background color on the justified line.

    I apreciate the solution for these problems so that we can find a better way to import the documents in both technologies without any lost.

  2. Cristiano
    Cristiano avatar
    13 posts
    Member since:
    Feb 2012

    Posted 16 Apr 2015 in reply to Cristiano Link to this post

    My apologies, I apreciate that you check this link instead of the last one I sent you.
  3. Alexander Popov
    Alexander Popov avatar
    1434 posts

    Posted 20 Apr 2015 Link to this post

    Hello Cristiano,

    The first issue you reported is caused by what the server returns. Basically, the Editor widget will render exactly what you have passed to its value method. You can try pasting the result in a new HTML file and see the same results as in the Editor. This also suggests that the second issue has the same origins.

    Alexander Popov

    See What's Next in App Development. Register for TelerikNEXT.

Back to Top