I attached a simple program that import a html file (with format and images) and export it. The exported file is very different from the original, without format and without images.
Thank you
Luigi
1 Answer, 1 is accepted
0
Accepted
Vladislav
Telerik team
answered on 16 Nov 2023, 01:21 PM
| edited on 16 Nov 2023, 01:25 PM
Hi Gianluca,
Thank you for providing the sample app, with it I was able to observe the formatting issues. I have split my answer into several points, covering the main discrepancies that I was able to pinpoint while comparing both HTML files.
The differences are mostly related to incompatibilities between the different formats. WordsProcessing is based on the Office Open XML standard (used by DOCX documents) and while importing, it matches the HTML elements to its model. However, this standard doesn't have the same elements and definitions as in HTML. Examples of these are the div elements which are imported as paragraphs. This leads to ignoring the element's width, causing it to be centered inside the window and not respecting the input dimensions of the rectangle it should fit. Also, this is what causes the indented text to be rendered to the left, as the paragraph does have positioning properties. As a possible workaround, if you have control over the generation of the HTML document, you can use tables to format the text.
The image not showing is caused by this known missing feature - WordsProcessing: Add support for the background tag. You can vote for its implementation and subscribe to receive notifications when the status changes. Until the feature is implemented you can ordinary <img> element.
I would like to apologize for the inconvenience these issues might be causing you.