RichTextBox HtmlFormatProvider export overflow document (especially table).

1 Answer 38 Views
RichTextBox
Kamran
Top achievements
Rank 3
Iron
Veteran
Iron
Kamran asked on 30 Mar 2022, 05:17 PM

I am inserting text in Richtextbox control from word document. Richtextbox load document correctly and formatting is valid as per MS word document. 

Then save document as html and reopen document in Richtextbox. I noticed that Table content is overflowed in paged layout i.e. Columns are clipped or not showing in document area. And also print incomplete document. As I stated when load document, formatting is correct, but exporting document to html and reloading html generated document, this issue happened.

Moreover there is some formatting issue as I highlighted in attached sample image.

This issue can be reproduced in Telerik UI for WPF demos. Following steps to reproduce issue.

  1. In Richtextbox open or paste content from attached sampleDocument.docx document. Document is loaded, and formatting is valid.
  2. Save as html. sample html output is attached for reference
  3. Open saved html document in Richtextbox. You will notice Table formatting/ alignment is not as per actual document.

I am using Telerik UI for WPF R1 2022

 

 

1 Answer, 1 is accepted

Sort by
0
Svilen
Telerik team
answered on 04 Apr 2022, 02:16 PM

Hi, Kamran,

Thank you for reaching out to us with this query. My name is Svilen, and I’d be glad to help here.

I was able to reproduce the table formatting issue you mentioned. I have logged it on our feedback portal. You can track its progress, subscribe to status changes, and add your comment to it using this link - RichTextBox: HtmlFormatProvider: Exporting DOCX file containing merged cells to HTML results in incorrect cell width. I have updated your Telerik points as well. As much as I'd like to say otherwise, I am afraid I can't suggest a workaround for this issue at this time. We hope to have a fix ready in one of the upcoming internal builds, which you can access here - WPF Downloads. Please accept our apologies for the inconvenience caused.

As for the dashes you highlighted in your screenshot, they are caused by the fact that empty paragraphs are converted to HMTL as non-breaking spaces (<span>&nbsp;</span>). Since the styling on those paragraphs in the original document is underlined (see the bellow screenshot), when importing HTML back into MS Word or RadRichTextbox, they are treated as underlined spaces and visualized as per your screenshot. This behavior is identical in MS Word and you can confirm it by exporting the original file to HTML and then opening the new HTML file. I can suggest simply removing the underline styling in all empty paragraphs.

Please let me know if I can assist with anything else.

Regards,
Svilen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
RichTextBox
Asked by
Kamran
Top achievements
Rank 3
Iron
Veteran
Iron
Answers by
Svilen
Telerik team
Share this question
or