We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table is rendered outside the page margins after Joining DOTX and HTML documents using .NET

Hi,

We are using the Aspose word version 18.11.0.0 to generate word documents from HTML. Now, we want to migrate to the latest version 20.6.0.0. we are facing two issues which are described below, both of them are producible in the version 18.11.0.0 and 20.6.0.0.
Whenever there is a continuous text in a cell i.e. a text without spaces between words, the width of that particular column is increased and it is rendered outside the margin of the page. Also, as shown in the document that the header columns and the data columns are rendered on separate pages.

File “Apose Image.png” shows the difference between HTML and word output. File “Word Document.docx” is the actual produced document. This scenario can be produced by using file “Html data.html” and file “Blank.dotx” template.

We are using the following code:
Document htmlDoc = new Document(htmlFilePath, new Aspose.Words.HtmlLoadOptions() { LoadFormat = LoadFormat.Html, Encoding = Encoding.UTF8 });
Document templateDocument = new Document(templatePath);
templateDocument.AppendDocument(htmlDoc, ImportFormatMode.UseDestinationStyles);
SaveOutputParameters param = templateDocument.Save(docxFilePath);

Please look into this issue and let us know if any other help is required from our side.

Issue data.zip (77.1 KB)

Regards,
Asif Sharif

@asif.sharif

You are using Aspose.Words for .NET 20.6 in evaluation mode. Please get the temporary license and apply it before importing document into Aspose.Words’ DOM. We have attached the output document with this post for your kind reference.

20.6.zip (9.4 KB)